


      LLLLIIIINNNNTTTT((((1111))))                     ((((UUUUNNNNIIIIXXXX 5555....2222))))                    LLLLIIIINNNNTTTT((((1111))))



      NNNNAAAAMMMMEEEE
           lint - a C program checker

      SSSSYYYYNNNNTTTTAAAAXXXX
           lllliiiinnnntttt [ option ] ... file ...

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _L_i_n_t attempts to detect features of the C program files that
           are likely to be bugs, non-portable, or wasteful.  It also
           checks type usage more strictly than the compilers.  Among
           the things that are currently detected are unreachable
           statements, loops not entered at the top, automatic
           variables declared and not used, and logical expressions
           whose value is constant.  Moreover, the usage of functions
           is checked to find functions that return values in some
           places and not in others, functions called with varying
           numbers or types of arguments, and functions whose values
           are not used or whose values are used but none returned.

           Arguments whose names end with ....cccc are taken to be C source
           files.  Arguments whose names end with ....llllnnnn are taken to be
           the result of an earlier invocation of _l_i_n_t with either the
           ----cccc or the ----oooo option used.  The ....llllnnnn files are analogous to ....oooo
           (object) files that are produced by the _c_c(1) command when
           given a ....cccc file as input.  Files with other suffixes are
           warned about and ignored.

           _L_i_n_t will take all the ....cccc,....llllnnnn, and lllllllliiiibbbb----llll_x....llllnnnn (specified by
           ----llll_x) files and process them in their command line order.  By
           default, _l_i_n_t appends the standard C lint library (lllllllliiiibbbb----
           llllcccc....llllnnnn) to the end of the list of files.  However, if the ----pppp
           option is used, the portable C lint library (lllllllliiiibbbb----ppppoooorrrrtttt....llllnnnn)
           is appended instead.  When the ----cccc option is not used, the
           second pass of _l_i_n_t checks this list of files for mutual
           compatibility.  When the ----cccc option is used, the ....llllnnnn and the
           lllllllliiiibbbb----llll_x....llllnnnn files are ignored.

           Any number of _l_i_n_t options may be used, in any order,
           intermixed with file-name arguments.  The following options
           are used to suppress certain kinds of complaints:

           ----aaaa   Suppress complaints about assignments of long values to
                variables that are not long.

           ----bbbb   Suppress complaints about bbbbrrrreeeeaaaakkkk statements that cannot
                be reached.  (Programs produced by _l_e_x or _y_a_c_c will
                often result in many such complaints).

           ----hhhh   Do not apply heuristic tests that attempt to intuit
                bugs, improve style, and reduce waste.

           ----uuuu   Suppress complaints about functions and external



      Page 1                                                   (9010-E)






      LLLLIIIINNNNTTTT((((1111))))                     ((((UUUUNNNNIIIIXXXX 5555....2222))))                    LLLLIIIINNNNTTTT((((1111))))



                variables used and not defined, or defined and not
                used.  (This option is suitable for running _l_i_n_t on a
                subset of files of a larger program).

           ----vvvv   Suppress complaints about unused arguments in
                functions.

           ----xxxx   Do not report variables referred to by external
                declarations but never used.

           The following arguments alter _l_i_n_t's behavior:

           ----llll_x  Include additional lint library lllllllliiiibbbb----llll_x....llllnnnn.  For
                example, you can include a lint version of the Math
                Library lllllllliiiibbbb----llllmmmm....llllnnnn by inserting ----llllmmmm on the command
                line.  This argument does not suppress the default use
                of lllllllliiiibbbb----llllcccc....llllnnnn.  These lint libraries must be in the
                assumed directory.  This option can be used to
                reference local lint libraries and is useful in the
                development of multi-file projects.

           ----nnnn   Do not check compatibility against either the standard
                or the portable lint library.

           ----pppp   Attempt to check portability to other dialects (IBM and
                GCOS) of C.  Along with stricter checking, this option
                causes all non-external names to be truncated to eight
                characters and all external names to be truncated to
                six characters and one case.

           ----cccc   Cause _l_i_n_t to produce a ....llllnnnn file for every ....cccc file on
                the command line.  These ....llllnnnn files are the product of
                _l_i_n_t's first pass only, and are not checked for inter-
                function compatibility.

           ----oooo lib
                Cause _l_i_n_t to create a lint library with the name
                lllllllliiiibbbb----llll_l_i_b....llllnnnn.  The ----cccc option nullifies any use of the
                ----oooo option.  The lint library produced is the input that
                is given to _l_i_n_t's second pass.  The ----oooo option simply
                causes this file to be saved in the named lint library.
                To produce a lllllllliiiibbbb----llll_l_i_b....llllnnnn without extraneous messages,
                use of the ----xxxx option is suggested.  The ----vvvv option is
                useful if the source file(s) for the lint library are
                just external interfaces (for example, the way the file
                lllllllliiiibbbb----llllcccc is written).  These option settings are also
                available through the use of ``lint comments'' (see
                below).

           The ----DDDD, ----UUUU, and ----IIII options of _c_p_p(1) and the ----gggg and ----OOOO
           options of _c_c(1) are also recognized as separate arguments.
           The ----gggg and ----OOOO options are ignored, but, by recognizing these



      Page 2                                                   (9010-E)






      LLLLIIIINNNNTTTT((((1111))))                     ((((UUUUNNNNIIIIXXXX 5555....2222))))                    LLLLIIIINNNNTTTT((((1111))))



           options, _l_i_n_t's behavior is closer to that of the _c_c(1)
           command.  Other options are warned about and ignored.  The
           pre-processor symbol ``lint'' is defined to allow certain
           questionable code to be altered or removed for _l_i_n_t.
           Therefore, the symbol ``lint'' should be thought of as a
           reserved word for all code that is planned to be checked by
           _l_i_n_t.

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

                /*NOTREACHED*/
                     at appropriate points stops comments about
                     unreachable code.  (This comment is typically
                     placed just after calls to functions like
                     _e_x_i_t(2)).

                /*VARARGS_n*/
                     suppresses the usual checking for variable numbers
                     of arguments in the following function
                     declaration.  The data types of the first _n
                     arguments are checked; a missing _n is taken to be
                     0.

                /*ARGSUSED*/
                     turns on the ----vvvv option for the next function.

                /*LINTLIBRARY*/
                     at the beginning of a file shuts off complaints
                     about unused functions and function arguments in
                     this file.  This is equivalent to using the ----vvvv and
                     ----xxxx options.

           _L_i_n_t produces its first output on a per-source-file basis.
           Complaints regarding included files are collected and
           printed after all source files have been processed.
           Finally, if the ----cccc option is not used, information gathered
           from all input files is collected and checked for
           consistency.  At this point, if it is not clear whether a
           complaint stems from a given source file or from one of its
           included files, the source file name will be printed
           followed by a question mark.

           The behavior of the ----cccc and the ----oooo options allows for
           incremental use of _l_i_n_t on a set of C source files.
           Generally, one invokes _l_i_n_t once for each source file with
           the ----cccc option.  Each of these invocations produces a ....llllnnnn
           file which corresponds to the ....cccc file, and prints all
           messages that are about just that source file.  After all
           the source files have been separately run through _l_i_n_t, it
           is invoked once more (without the ----cccc option), listing all
           the ....llllnnnn files with the needed ----llll_x options.  This will print



      Page 3                                                   (9010-E)






      LLLLIIIINNNNTTTT((((1111))))                     ((((UUUUNNNNIIIIXXXX 5555....2222))))                    LLLLIIIINNNNTTTT((((1111))))



           all the inter-file inconsistencies.  This scheme works well
           with _m_a_k_e(1); it allows _m_a_k_e to be used to _l_i_n_t only the
           source files that have been modified since the last time the
           set of source files were _l_i_n_ted.

      FFFFIIIILLLLEEEESSSS
           /usr/lib               the directory where the lint
                                  libraries specified by the ----llll_x option
                                  must exist
           /usr/lib/lint[12]      first and second passes
           /usr/lib/llib-lc.ln    declarations for C Library functions
                                  (binary format; source is in
                                  ////uuuussssrrrr////lllliiiibbbb////lllllllliiiibbbb----llllcccc)
           /usr/lib/llib-port.ln  declarations for portable functions
                                  (binary format; source is in
                                  ////uuuussssrrrr////lllliiiibbbb////lllllllliiiibbbb----ppppoooorrrrtttt)
           /usr/lib/llib-lm.ln    declarations for Math Library
                                  functions (binary format; source is
                                  in ////uuuussssrrrr////lllliiiibbbb////lllllllliiiibbbb----llllmmmm)
           /usr/tmp/*lint*        temporaries

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           cc(1), cpp(1), make(1).

      BBBBUUUUGGGGSSSS
           _e_x_i_t(2), _l_o_n_g_j_m_p(3C)(_p_a_r_tof_s_e_t_j_m_p(_3_C)), and other functions
           that do not return are not understood; this causes various
           lies.



























      Page 4                                                   (9010-E)



