man(1) Manual page archive


     LINT(1)                                                   LINT(1)

     NAME
          lint, cyntax, cem - C program verifiers

     SYNOPSIS
          lint [ -abchnpuvx ] [ option ... ] file ...

          cyntax [ option ... ] file ...

          /usr/lib/cyntax/cem [ option ... ] file ...

     DESCRIPTION
          Lint checks, more thoroughly than cc(1), the syntactic
          validity and semantic consistency of one or more C program
          files. It is assumed that all the files are to be loaded
          together; they are checked for mutual compatibility.  Func-
          tion definitions for certain libraries are available to
          lint; these libraries are referred to by a conventional
          name, such as `-lm', in the style of ld(1).

          Any number of the option letters in the following list may
          be used.  The -D, -U, and -I options of cc(1) are also rec-
          ognized as separate arguments.

          p    Attempt to check portability to some other dialects of
               C.
          h    Apply heuristics to intuit bugs, improve style, and
               reduce waste.
          b    Report break statements that cannot be reached.
          v    Suppress complaints about unused arguments in func-
               tions.
          x    Report variables referred to by extern declarations,
               but never used.
          a    Report assignments of long values to int variables.
          c    Complain about casts which have questionable portabil-
               ity.
          u    Do not complain about functions and variables used and
               not defined, or defined and not used (this is suitable
               for running lint on a subset of files out of a larger
               program).
          n    Do not check compatibility against the standard
               library.

          Certain conventional comments in the C source will change
          the behavior of lint:

          /*NOTREACHED*/
               at appropriate points.  Stop comments about unreachable
               code.
          /*VARARGSn*/
               Suppress the usual checking for variable numbers of

     LINT(1)                                                   LINT(1)

               arguments in the following function declaration.  The
               data types of the first n arguments are checked; a
               missing n is taken to be 0.
          /*PRINTFLIKEn*/
               The data types of the first n arguments are checked as
               usual.  The remaining arguments are checked against the
               nth argument, which is interpreted as a printf(3) for-
               mat string.
          /*SCANFLIKEn*/
               Similarly for scanf(3).
          /*NOSTRICT*/
               Shut off strict type checking in the next expression.
          /*ARGSUSED*/
               Turn on the -v option for the next function.
          /*LINTLIBRARY*/
               at the beginning of a file.  Shut off complaints about
               unused functions in this file.

          Cyntax makes checks similar to those of lint, more stringent
          about syntax, less observant of portability issues.  It
          keeps type information gleaned from source files, whose
          names end with `.c', in `object files' with corresponding
          names ending in `.O'.  If all goes well it will cross check
          among all the `.c' and `.O' input files.

          Options -D, -I, -U, -o, -l are as in cc(1). Options -O, -P,
          -g, -p, and -s are ignored.  Other options are:

          -c   Suppress cross checking.
          -d   Passed to cem.
          -h   Base object files on the basename of the source file
               rather than the full pathname.
          -n   Do not check compatibility against the standard
               library.
          -G   Change default directory of include files to pass -lg
               to cem instead of -lc.
          -j   Change default directory of include files to pass -lj
               to cem instead of -lc.
          -k   Change default directory of include files to pass -lk
               to cem instead of -lc.
          -w   Enable pedantic warning diagnostics.
          -m   equivalent to `-j -DMUX'.
          -v   Report what cyntax is actually doing.
          -Vfunc:n
               Declare function func to have a variable number of
               arguments, the first n of which are to be type checked.

          Cem (cemantics), the cross-checker, is normally invoked only
          by cyntax. It also has options, some of which cyntax can't
          be coerced into providing.  Besides -o and -l, they are:

          -m   Don't believe file modification times.  These are

     LINT(1)                                                   LINT(1)

               normally used to avert redundant type checking.
          -d   Debug: print ascii version of `.O' files on standard
               output.
          -p   Be pedantic about type checking.
          -t   Unconditionally include file modification times in
               diagnostics.
          -v   Use a verbose format for type names.

     FILES
          programs
          declarations for standard functions
          declarations for portable functions
          lex(1).