Oracle® Solaris Studio 12.4: C User's Guide

Exit Print View

Updated: March 2015
 
 

4.3 lint Command-Line Options

The lint program is a static analyzer. It cannot evaluate the runtime consequences of the dependencies it detects. For example, certain programs might contain hundreds of unreachable break statements that are of little importance that lint flags nevertheless. For example, you could use the lint command-line options and special directives embedded as comments in the source text, as follows:

  • Invoking lint with the -b option suppresses all the error messages about unreachable break statements.

  • Precede any unreachable statement with the comment /*NOT REACHED*/ to suppress the diagnostic for that statement.

The lint options are listed below alphabetically. Several lint options relate to suppressing lint diagnostic messages. These options are also listed in Table 4–8, following the alphabetized options, along with the specific messages they suppress. The options for invoking enhanced lint begin with -N.

lint recognizes many cc command-line options, including -A, -D, -E, -g, -H, -O, -P, -U, -ansi, -std=value, -pedantic, -Xa, -Xc, -Xs, -Xt, and -Y, although -g and -O are ignored. Unrecognized options are warned about and ignored.