⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lint.1

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 1
字号:
.TH lint 1 RISC.SH Namelint \- a C program checker.SH Syntax.B lint[ option ] ... file ....SH DescriptionThe .PN lintcommand attempts to detect features of the C program files that arelikely to be errors, nonportable, or wasteful..NXR "A C program checker" "lint(1)"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 locatefunctions that return values in some places, but not in others,functions called with varying numbers or types of arguments,and functions whose values are not usedor whose values are used but none returned..PPArguments whose names end with.PN \&.care interpreted as C source files.Arguments whose names end with.PN \&.lninterpreted as the result of an earlier invocation of.PN lintwith either the.B \-cor the .B \-ooption used.The.PN \&.lnfiles are analogous to.PN \&.o(object) files that are produced by the.PN cccommand when given a.PN \&.cfile as input.  Files with other suffixes are warned about and ignored..PPThe .PN lintcommand takes all the.PN \&.c ,.PN \&.ln ,and .PN llib-lx.ln(specified by.BI \-l x\fR)files and processes them in their command line order.  By default, the.PN lintcommand appends the standard C.PN lintlibrary.PN (llib-lc.ln)to the end of the list of files.However, if the.B \-poption is used, the portable C .PN lintlibrary.PN (llib-port.ln)is appended instead.When the.B \-coption is not used,the second pass of.PN lintchecks this list of files for mutual compatibility.  When the.B \-coption is used, the.PN \&.lnand the.PN llib-lx.lnfiles are ignored..SH OptionsAny number of.PN lintoptions may be used, in any order, intermixed with filename arguments.The following options are used to suppress certain kinds of warning:.TP 5.B \-aSuppress warnings about assignments of long values to variables that are notlong..TP 5.B \-bSuppress warnings about break statements that cannot be reached.(Programs produced by .PN lexor.PN yaccoften result in such warnings)..TP 5.B \-hDo not apply heuristic tests that attempt to intuit bugs, improvestyle, and reduce waste..TP 5.B \-uSuppress warnings about functions and externalvariables used and not defined, or defined and not used.(This option is suitable when running.PN linton a subset of files of a larger program)..TP 5.B \-vSuppress complaints about unused arguments in functions..TP 5.B \-xDo not report variables referred to by external declarations but never used..PPThe following arguments alter the behavior of.PN lint ..TP 5.BI \-l x\^Include additional.PN lintlibrary.PN llib-lx.ln .For example, you can include a.PN lintversion of the Math Library.PN llib-lm.lnby inserting.B \-lmon the command line.  This argument does not suppress the default use of.br.PN llib-lc.ln .These lint libraries must be in the assumed directory.This option can be used to reference local.PN lintlibraries and is useful in the development of multi-file projects..TP 5.B \-nDo not check compatibility against either the standard or the portable.PN lintlibrary..TP 5.B \-pAttempt to check portability to other dialects(\s-1IBM\s0 and \s-1GCOS\s0) of C.Along with stricter checking,this option causes all non-external names to be truncatedto eight characters and all external namesto be truncated to six characters and one case..TP 5.B \-cCause.PN lintto produce a.PN \&.lnfile for every.PN \&.cfile on the command line. The.PN \&.lnfiles are the product of the.PN lint command's first pass only, and are not checked for inter-function compatibility..TP 5.BR \-o " lib"Cause.PN lintto create a lint library with the name.PN llib-llib.ln .The.B \-coption nullifies any use of the.B \-ooption.The.PN lintlibrary produced is the input that is given to the second pass.PN lint . The.B \-ooption simply causes this file to be saved in the named.PN lintlibrary.  To produce a.PN llib-llib.lnwithout extraneous messages, use of the.B \-xoption is suggested.  The.B \-voption is useful if the source files for the.PN lintlibrary are just external interfaces (for example, the way the file.PN llib-lcis written).  These option settings are also available through theuse of.PN lintcomments which are described later..PPThe.BR \-D ,.BR \-U ,and.B \-Ioptions of.PN cppand the.B \-gand.B \-Ooptions of.PN ccare also recognized as separate arguments.The.BR \-g " and " \-Ooptions are ignored, but, by recognizing these options, the behavior of.PN lint is closer to that of the.PN cccommand's second pass.  Other options are warned about and ignored.The pre-processor symbol lint is defined to allow certain questionable code tobe altered or removed for.PN lint .Therefore, the symbol lint should be thought of as a reserved word for all code that is planned to be checked by.PN lint ..PPThe.PN lintcommand produces its first output on a per-source-file basis.Warnings regarding included files are collected and printedafter all source files have been processed.Finally, if the.B \-coption is not used, information gathered from all input files is collectedand checked for consistency.  At this point, if it is not clear whether awarning stems from a given source file or from one of its included files,the source file name is printed followed by a question mark..PPThe behavior of the.B \-cand the.B \-ooptions allows for incremental use of.PN linton a set of C source files.  Generally, one invokes.PN lintonce for each source file with the.B \-coption.Each of these invocations produces a.PN \&.lnfile which corresponds to the.PN \&.cfile, and prints all messages that are about just that source file.After all the source files have been separately run through.PN lint ,it is invoked once more (without the.B \-coption), listing all the.PN \&.lnfiles with the needed.BI \-l xoptions.  This prints all the inter-file inconsistencies.This scheme works well with.PN make ;it allows.PN maketo be used to.PN lintonly the source files that have been modified sincethe last time the set of source files were checked by.PN lint ..SH RestrictionsThe system call.PN exit ,the function.PN longjmp ,and other functions that do not return a value are not interpretedcorrectly by the .PN lintcommand.  .PPCertain conventional comments in the C source change the behavior of.PN lint :.TP 18/\(**\s-1NOTREACHED\s0\(**/at appropriate pointsstops comments about unreachable code.(This comment is typically placed just after calls to functions like.PN exit)..TP 18.RI /\(**\s-1VARARGS\s+1 n \(**/suppresses the usual checking for variable numbers of argumentsin the following function declaration.  The data types of the first.I n\^arguments are checked;a missing.I n\^is taken to be 0..TP 18/\(**\s-1ARGSUSED\s0\(**/turns on the.B \-voption for the next function..TP 18/\(**\s-1LINTLIBRARY\s0\(**/at the beginning of a file shuts off complaints about unused functionsand function arguments in this file.  This is equivalent to using the.BR \-v " and " \-xoptions..SH Files.TP 20 /usr/lib/cmplrs/cc/lintthe directory where the lint libraries specified by the.BI \-l xoption must exist.TP/usr/lib/cmplrs/cc/lint[12]first and second passes.TP/usr/lib/cmplrs/cc/lint/llib-lc.lndeclarations for C Library functions (binary format; source is in.PN /usr/lib/cmplrs/cc/lint/llib-lc ).TP/usr/lib/cmplrs/cc/lint/llib-lcV.lnSystem V declarations for standard functions.TP /usr/lib/cmplrs/cc/lint/llib-lcP.lnPOSIX declarations for standard functions.TP/usr/lib/cmplrs/cc/lint/llib-port.lndeclarations for portable functions (binary format; source is in.PN /usr/lib/cmplrs/cc/lint/llib-port ).TP/usr/lib/cmplrs/cc/lint/llib-lm.lndeclarations for Math Library functions (binary format; source is in.PN /usr/lib/cmplrs/cc/lint/llib-lm ).TP/usr/tmp/\(**lint\(**temporaries.SH See Alsocc(1), cpp(1), make(1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -