What's New in PC-lint/FlexeLint Version 9.00?
Designer's Notes |
Press Release | How to order an update
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.
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 ’type’ 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’s 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 ’underlying 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 \0xFF , decimal characters following
an octal escape sequence, or the embedded nul. We also look for numeric
constants that have different types depending on language dialect.
Expressions -- We report on compile-time zero’s being added, multiplied, ORed, etc. to
expressions and on deducable zero’s added, multiplied, etc. Our
order-of-evaluation checking has been extended to include the case of functions
modifying objects and the suspicious looking: p ? a : b = 1 .
We also look for non 0/1 assignments to boolean typed objects.
We issue warnings about unusual sizeof arguments.
const qualification -- We now report on global or static variables that
could be made const and global or static pointers that could be declared
as pointing to const.
Unusual Declarations -- We report on the following declaration
int a:5;
as its meaning is not defined by the standard. We also look for assignment
operators that do not return a reference to a const ref.
Initializer Functions -- A new feature of Version 9 is the notion of an
initializer. See the initializer semantic. Message 1565 warns when an initializer fails
to carry out its mission and message 1566 points out when an initializer may be needed.
There are similar considerations for the cleanup semantic.
Include Guards -- Headers are examined to determine whether they
contain standard include guards.
Pointer and Reference Anomalies -- New messages that involve the ever
dangerous pointer and the innocent appearing reference are as follows. We look for
- pointers to auto being assigned to a member of the current class
- pointers to non-POD class being passed to POD-seeking functions such as memcpy
- string constants assigned to initialize non-const char pointers
- an uninitialized reference used to initialize another reference
- a reference member not appearing in a mem-initializer
- returning the address of a reference parameter
- passing the address of a reference parameter into the caller’s address space
- assigning the address of a reference parameter to a static variable.
Unreferenced (but constructed) class variables -- Ever try to find all those
unreferenced CString’s? We didn’t complain in the past because technically speaking,
they were referenced by their own constructor. Such variables now get a new Info message
so they can be picked out and eliminated.
|
|
|
Home | Contact
| Order
PC-lint and FlexeLint are trademarks of Gimpel Software
Copyright © 2011, Gimpel Software, All rights reserved.
|
|