|
PC-lint for C/C++ [8.0]
What’s New in PC-lint v8.0
Inter-function Value Tracking
The powerful inter-statement value tracking introduced in earlier versions of PC-lint/FlexeLint has been extended to cross function boundaries. Functions called with specific values are later processed, with these values used to initialise parameters. To take full advantage of inter-function tracking, a multi-pass operation has been introduced. The user can control the number of passes.
Machine readable documentation
Message descriptions will always be just a mouse click away.
New warnings and gotchas
- pointers to insufficiently large areas
- the dreaded malloc( strlen (s+1) )
- the foolish new int(10)
- when 64 bit pointers meet with 32 bit integer arithmetic
- when pointer parameters can be made pointers to const and when reference parameters can be declared as const
- when a member function can be made const
- shallow copies of member pointers within copy constructors and assignment operators
- when a test of assignment is not surrounded by parentheses.
- confusing unparenthesised operator sequences such as A/B*C
- returning a temporary via a reference
- a reference initialisation that can cause a dangerous capability gain
- exception irregularities
- cases where the dynamic_cast should be used and where it is not appropriate
- when string literals are placed in harm's way via assignment to char *
- when white space may intervene between a backslash and a newline creating an invisible ambiguity
- strange comparisons that can't possibly succeed
New Elective Notes
- use of 0 when NULL is intended
- situations where const can be added to parameters, and variables, and pointers
- non const non volatile global variables, locating these can assist multi-threaded applications in detecting non re-entrant situations
- much more thorough exception analysis (for C++ users)
- prototypes missing parameter names
- suspicious conditions when you suspect you have order-of-initialisation problems
- pointer subtractions which can be a problem in conditions of maximum memory
- conditions which can give rise to alignment problems
New and revised options of interest
- -sem enhancements include the ability to specify that return pointers from functions are freshly allocated and that pointer arguments to functions are consumed (i.e. the function takes custody of the pointer)
- user-defined printf and scanf codes
- a 'poor-man's' class hierarchy for C code
- better support for defining non-standard preprocessing commands
- better support for defining and manipulating reserved words
Other options and features
- To better support intelligent editors and IDE's, PC Lint produce’s special additional messages when a given message contains interior location information.
- Offer a complete no-holds-barred C++ exception analysis.
- Require a specific form of lint comment when program flow falls through from one (nontrivial) case to the next.(option -fallthrough)
- The _lint predefined identifier now contains version information. For Version 8.00 it has a value of 800.
- Added explicit support for a subset of the MISRA (Motor Industry Software Reliability Association) standard.
- Alignment is checked and can be set via a -a option similar to the -s options to set sizes.
- According to the Standard, new (and new[]) do not return NULL when out of storage but rather throw an exception (bad_alloc).
- Support for Microsoft C/C++ and compatible systems include: .dsp processing, #import, and pragmas once and message
- Support for Gnu C/C++ consists of a -cgnu option, variable macro arguments and a form of 'testable' assignment that non-Gnu users can use.
- Support for Borland's C++ Builder including truncated file names
- Continued improvement in support for embedded systems compilers
New Error Inhibition Options
- -e{ # [,#]... } inhibits messages(s) # for the next statement or declaration
- --e{ # [,#]... } inhibits messages(s) # within a braced region
- -etemplate( # [,#] ... ) inhibits
- +etemplate( # [,#] ... ) re-enables message(s) # while expanding templates
New Verbosity Options
- -v...c Issues a verbosity message whenever a unique function call is recorded
- -v...d Indicates whether modules are processed as C or C++
- -v...h- If the 'h' is followed immediately by a '-' then the hierarchy will be compressed producing the same tree in half the lines
- -v...t Indicates when a template is being instantiated
- -v...w Indicates when a function is being walked with specific arguments
New Flag Options
- fdl has been enhanced to allow for pointer difference to be long long
- flm Lock Message format
- fnn new can return Null
- frl Reference Location information
- fsp SPecific function call processing
- fss Sub-struct allows C struct's to be related as in inheritance
- ftg turns off TRiGraph processing
- ftr TRuncate flag to support Borland include's
New Message Presentation Options
- -append(#,string ) can be used to append a trailing message (string) onto an existing error message for error #
Additional Other Options
- -background PC-lint/FlexeLint will run at a reduced priority under Windows NT.
- -fallthrough The flow of control is falling through from one case switch to another.
- -headerwarn( filename [,filename]... ) Can be used to alert the user that the specified header file is being used.
- -ident1(string) This option allows the user to define a one-character identifier.
- +libdir Enhanced to support wild cards
- +libh Enhanced to support wild cards
- +linebuf This option doubles the size of the line buffer, which is initially 600 bytes.
- -passes( k [,Options1 [,Options2] ] ) Allows multiple passes over the set of modules provided as input.
- -ppw_asgn( word1, word2 ) Assigns the preprocessor semantics associated with word2 to word1 and activates word1.
- --ppw( word1 [, word2] ... ) Removes preconceived notions as to what the preprocessor word(s) mean.
- +pragma( identifier, once ) This option allows the programmer to establish identifier as a pragma code to indicate that the header is to be included just once.
- +pragma( identifier, message ) This option allows the programmer to establish an arbitrary identifier as a pragma that will produce a message to standard out.
- -pragma( identifier ) This option will remove the pragma whose name is identifier.
- -printf_code( Code [, Type] ) This option allows user-defined printf codes.
- --rw( word1 [, word2] ... ) Removes preconceived notions as to what the potential reserved word(s) mean and gives it a default meaning (to ignore it).
- -rw_asgn( word1, word2 ) This option assigns the reserved word semantics of word2 to word1.
- -scanf_code( Code [, Type] ) This option allows user-defined scanf codes.
- -sem This option has been enhanced to support a number of new semantics.
- --u This option is like -u except that any module at a lower .lnt level is ignored.
Compiler Adaptation
- -cgnu This option is used for the Gnu compiler.
- _to_eol This adds to the suite of special keywords that enable Lint to pass over unusual non-standard constructions
- They now support the @ feature which appears in many embedded systems compilers
Pre-Processor Directives
- #import supports the Microsoft preprocessor directive of the same name
- #unassert preprocessor directive undoes the effects of #assert
- PC-lint features "Inter-function Value Tracking." The powerful inter-statement value tracking introduced in earlier versions of PC-lint has been extended across function boundaries. Functions called with specific values are processed with these values used to initialize parameters. To take full advantage of inter-function tracking, a multi-pass operation has been introduced.
- PC-lint also includes exception analysis, identification of const opportunities, and checking for adherence to the MISRA (Motor Industry Software Reliability Association) Guidelines. There are 88 error/warning messages and 20 options.
- PC-lint includes rigorous checking: These checks include user-defined function semantic checking, pointer tracking, strong type checking, control-flow based analysis of variable initialization, loss of precision and strange uses of Booleans.
PC-lint runs on Microsoft Windows NT/95/98/2000/ME, MS-DOS and OS/2.
|