You invoke lint with a command of the form
$lint examines code in two passes. In the first, it checks for error conditions local to C source files, in the second for inconsistencies across them. This process is invisible to the user unless lint is invoked with -c:
$That command directs lint to execute the first pass only and collect information relevant to the second -- about inconsistencies in definition and use across file1.c and file2.c -- in intermediate files named file1.ln and file2.ln:
lint -c file1.c file2.c
$In this way, the -c option to lint is analogous to the -c option to cc, which suppresses the link editing phase of compilation. Generally speaking, lint's command line syntax closely follows cc's.
ls -1file1.c file1.ln file2.c file2.ln
When the .ln files are linted
$the second pass is executed. lint processes any number of .c or .ln files in their command line order. So
lint file1.ln file2.ln
$directs lint to check file3.c for errors internal to it and all three files for consistency.
lint file1.ln file2.ln file3.c
lint searches directories for included header files in the same order as cc
Use the -I option to lint as you would the -I option to cc. If you want lint to check an included header file that is stored in a directory other than your current directory or the standard place, specify the path of the directory with -I as follows:
$You can specify -I more than once on the lint command line. Directories are searched in the order they appear on the command line. Of course, you can specify multiple options to lint on the same command line. Options may be concatenated unless one of the options takes an argument:
$That command directs lint to
lint -cp -Idir