DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Using programming tools

Using lint

The lint(CP) program examines source code to identify sections of code that the compiler may flag as incorrect. In many cases, lint identifies as incorrect sections of code that the compiler accepts but that uses poor programming practice that may affect portability and robustness.

To find out how portable and robust our sample program is, run testcase.c through lint with the command:

   lint testcase.c
lint produces the following display:
   static unused
       (61) __c

declared global, could be static PrintWords testcase.c(21) GetWords testcase.c(43) Words testcase.c(12) WordCount testcase.c(13)

The warning messages indicate that several functions could have been declared. It also points that variable '__c' has been declared but never used. This is the result of the variable being declared in the system header file ctype.h but never used by testcase.c. We also never use the macro defined in ctype.h in testcase.c, which references that symbol. For more information on using lint, see ``lint analyzer'' and lint(CP).
Next topic: Using cflow
Previous topic: Using cscope

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003