?? lint.1
字號:
.\" SCCSID: @(#)lint.1 3.1 11/23/87.TH lint 1 VAX.SH Namelint \- check C code.SH Syntax.B lint[\fIOptions\fR] \fIfile...\fR.SH Description.NXR "lint command".NXR "C program" "verifying"The.PN lintcommand detects features of the C program.I fileswhich arelikely to be bugs, non-portable, or wasteful.It also checks the type usage of the program more strictlythan the compilers.Among the things which are currently found areunreachable 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 findfunctions which return values in some places and not in others,functions called with varying numbers of arguments,and functions whose values are not used..PPBy default, it is assumed that all the.I filesare to be loaded together; they are checked formutual compatibility.Function definitions for certain libraries are available to.PN lint .These libraries are referred to by aconventional name,such as `\-lm', in the style of .MS ld 1 .Arguments ending in .lnare also treated as library files. .PPTo create .PN lintlibraries,use the.B \-Coption as follows:.EXlint \-Cdlib files . . ..EE.PPThe C sources of library.I dlibare .I files.The result is the library file \fRllib-l\fIdlib\fP\.lnin the correct library format suitable for linting programsusing.IR dlib .Note that if you have set the System V environmentvariable,the System V lint library is used.For further information, see .MS intro 2 ..SH Options.NXR "lint command" "options"Any number of the options in the following listmay be used.The.BR \-D "\*S,".BR \-U "\*S,"and.B \-Ioptions of .MS cc 1are also recognized as separate arguments..sp.IP \fB\-a\fR 5Report assignments of long values to int variables..IP \fB\-b\fR Report.B breakstatements that cannot be reached. (This is not thedefault because most.PN lexand many.PN yaccoutputs produce dozens of such comments.).IP \fB\-c\fR Complain about casts that have questionable portability..IP \fB\-h\fR Apply a number of heuristic tests to attempt to findbugs, improve style, and reduce waste..IP \fB\-n\fR Do not check compatibility against the standard library..IP \fB\-p\fR Attempt to check portability to the IBM and GCOS dialectsof C..IP \fB\-u\fR Do not complain about functions and variables used andnot defined, or defined and not used. (This is suitablefor running.PN linton a subset of files out of a larger program.).IP \fB\-v\fRSuppress complaints about unused arguments in functions..IP \fB\-x\fRReport variables referred to be extern declarations,but never used..IP \fB\-Y\fIenvironment\fRCompile C programs for \fIenvironment\fP. If \fIenvironment\fP isSYSTEM_FIVE or omitted, defines SYSTEM_FIVE for the preprocessor, .PN cpp ,and if the loader is invoked,specifies that the System V version of the C runtime library isused. Also, if the math library is specified with the \fB\-lm\fRoption, the System V version is used. If \fIenvironment\fP isPOSIX, defines POSIX for the preprocessor. If the environment variable PROG_ENV has the value SYSTEM_FIVE or POSIX, the effect is thesame as specifyingthe corresponding \fB\-Y\fIenvironment\fR option to .PN cc .The \fB-Y\fP option overrides the PROG_ENV variable; \fB-YBSD\fP can beused to override all special actions..IP \fB\-z\fRDo not complain about structures that are never defined(for example, using a structure pointer without knowingits contents.).SH Restrictions.NXR "lint command" "exit system call and"The .MS exit 2system calls and other functions that do not returnare not understood; this causes various anomalies in.PN lintoutput..PPCertain conventional comments in the C sourcechange the behavior of.PN lint:.TP 20/*NOTREACHED*/At appropriate points,stops comments about unreachable code..TP.RI /*VARARGS n */Suppressesthe usual checking for variable numbers of argumentsin the following function declaration.The data types of the first.I narguments are checked;a missing.I nis taken to be 0..TP/*NOSTRICT*/Shuts off strict type checking in the next expression..TP/*ARGSUSED*/Turns on the.B \-voption for the next function..TP/*LINTLIBRARY*/At the beginning of a file, shuts off complaints aboutunused functions in this file..SH Files.ta \w'/usr/lib/lint/llib-port.ln 'u.TP 20/usr/lib/lint1 Program.TP/usr/lib/lint2 Program.TP/usr/lib/lint/llib-lc.ln Declarations for standard functions.TP/usr/lib/lint/llib-lc Human readable version of above.TP/usr/lib/lint/llib-lcV.ln System V declarations for standard functions.TP/usr/lib/lint/llib-lcP.lnPOSIX declarations for standard functions.TP/usr/lib/lint/llib-port.ln Declarations for portable functions.TP/usr/lib/lint/llib-port Human readable . . ..TPllib-l*.ln Library created with.B \-C.SH See Alsocc(1).sp``Lint, a C Program Checker'',.I ULTRIX Supplementary Documents,Vol. II:Programmer
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -