PC-lint 1.3 for C/C++
- PC-lint 1.3 for C/C++
介紹Static Variable Tracking -- We now incorporate variables of static storage duration in our value tracking. These include not only variables that are nominally static, as local to a function and local to a module, but also external variables.
PC-lint for C/C++
Thread Analysis -- We examine multi-threaded programs for correct mutex locking and report on variables shared by multiple threads that are used outside of critical sections.
Pre-compiled Headers can dramatically reduce the time spent in processing multiple modules.
Dimensional Analysis -- We now support, through the strong type mechanism, the classical dimensional analysis that engineers and physicists have traditionally employed in verifying equations. A ype can now be a ratio or product of other types and the compound types are checked for consistency across assignment boundaries.
Stack Usage -- We can report on the overall stack requirements of any program whose function calls are non-recursive and deterministic (i.e. calls not made through function pointers). This is very useful for embedded systems development where the amount of stack required can be mission critical. A complete detailed report of stack usage for each function is available as well.
The deprecate option allows the programmer to deprecate particular symbols in any of the following categories: function, keyword, macro and variable.
Message Enhancement and Control
You may now enhance any message parameterized by Symbol so that the symbol type is also given.
You may suppress any message parameterized by Symbol on the basis of the type of the symbol.
You can suppress messages parameterized by String on the basis of that string.
You may activate a message for a particular Symbol (or set of symbols) that is otherwise inhibited.
You may suppress a message while calling a particular function, while calling library functions and while invoking library macros.
Enhanced MISRA checking includes the detection of recursion, support for the MISRA 2 nderlying type concept, determination of side effects for functions and MISRA C++ support.
Source-echo mode enables you to specify that lint messages appear embedded within the context of the original source code.
html support provides that output can appear in the html format, suitable for a browser and handsomely color coded.
Program Info -- A comprehensive collection of information about your program is optionally provided yielding information on files, types, symbols and macros for simple viewing or in a manner absorbable by a database or spreadsheet. This information can be used for many purposes, including naming-style conventions.
Macro Scavenging -- This feature turns PC-lint/FlexeLint into a seeker of built-in macros supported by a compiler and lying about within compiler header files. This is perfect for the unknown compiler with long and forgotten macros ready to trip up a third party processor such as PC-lint/FlexeLint.
New semantics have been added to the -sem option:
Initializer indicates the member function can be relied upon to initialize all the members.
Cleanup indicates that the function is expected to free or zero all pointer members.
inout(i) indicates that the ith parameter will read as well as write to its (indirect) argument.
pod(i) indicates that the ith argument requires a pointer to a POD ( Plain Old Datatype).
Pure can be used to indicate that the function is a pure function.
A number of new semantic flags support multi-threading analysis: thread, thread_lock, thread_unlock, and thread_protected and many others.
New Messages -- Version 9.0 has some 146 new messages. Some of the more prominent of these are as follows:
Read-Write Analysis -- Ever wonder whether each assigned value to a (local) variable actually has a chance of being used before another value is assigned to the variable or before exiting the program? We now detect this condition
for clause Scrutiny -- for clauses are now subject to intense scrutiny. We complain if the variable tested in the 2nd expression is not the same as the variable modified in the third or the variable initialized in the first. We warn if the testing direction (2nd expression) seems inconsistent with the increment direction (3rd expression), or if the expression tested is inconsistent with the expression incremented, or if the loop index variable is modified in the body of the loop.
Pre-determined Predicates -- We can detect in a variety of circumstances that the value of a predicate is pre-determined to be true or false.
Constants come under careful examination. Within string or character constants we look for the psuedo-hex character
PGI compilers can generate a single PGI Unified Binary™ executable fully optimized for both Intel EM64T and AMD64 processors, delivering all the benefits of a single x64 platform while enabling you to leverage the latest innovations from both Intel and AMD. The following example illustrates the benefits of the PGI Unified Binary using the Parallel Ocean Program (POP).