]> andersk Git - splint.git/blob - doc/lclint.1
Removed /bin/csh from tainted/Makefile
[splint.git] / doc / lclint.1
1  .\" $Id$
2 .TH lclint 1 "A tool for statically checking C programs"
3
4 .SH NAME
5 lclint \- A tool for statically checking C programs
6
7 .SH SYNOPSIS
8 .BR lclint
9 [options]
10
11 .SH DESCRIPTION
12 .BR LCLint
13 is a tool for statically checking C programs. With minimal effort, LCLint can
14 be used as a better lint(1).
15 If additional effort is invested adding annotations to programs, LCLint can
16 perform stronger checks than can be done by any standard lint.
17
18 .SH OPTIONS
19
20 .TP 6
21 .B \-help
22 Shows help
23
24 .PP
25 .B Initialization
26
27 These flags control directories and files used by LCLint. They may be used from the
28 command line or in an options file, but may not be used as control comments in the
29 source code. Except where noted. they have the same meaning preceded by \- or +. 
30
31 .TP 6
32 .BI \-tmpdir " directory"
33 Set directory for writing temp files. Default is /tmp/. 
34
35 .TP 6
36 .BI \-I " directory"
37 Add directory to path searched for C include files. Note there is no space after the I,
38 to be consistent with C preprocessor flags. 
39
40 .TP 6
41 .BI \-S " directory"
42 Add directory to path search for .lcl specification files. 
43
44 .TP 6
45 .BI \-f " file"
46 Load options file <file>. If this flag is used from the command line, the default ~/.lclintrc file is
47 not loaded. This flag may be used in an options file to load in another options file. 
48
49 .TP 6
50 .B \-nof 
51 Prevents the default options files (./.lclintrc and ~/.lclintrc) from being loaded. (Setting
52 -nof overrides +nof, causing the options files to be loaded normally.) 
53
54 .TP 6
55 .BI \-systemdirs " directories"
56 Set directories for system files (default is "/usr/include"). Separate directories with colons (e.g.,
57 "/usr/include:/usr/local/lib"). Flag settings propagate to files in a system directory. If
58 -systemdirerrors is set, no errors are reported for files in system directories. 
59
60 .PP
61 .B Pre-processor
62
63 These flags are used to define or undefine pre-processor constants.
64 The -I<directory> flag is also passed to the C pre-processor.
65
66 .TP 6
67 .BI \-D " initializer"
68 Passed to the C pre-processor. 
69
70 .TP 6
71 .BI \-U " initializer"
72 Passed to the C pre-processor 
73
74 .PP
75 .B Libraries
76 These flags control the creation and use of libraries.
77
78 .TP 6
79 .BI \-dump " file"
80 Save state in <file> for loading. The default extension .lcd is added if <file> has no extension. 
81
82 .TP 6
83 .BI \-load " file"
84 Load state from <file> (created by -dump). The default extension .lcd is added if <file> has no
85 extension. Only one library file may be loaded. 
86
87 By default, the standard library is loaded if the -load flag is not used to load a user library. If no user library is
88 loaded, one of the following flags may be used to select a different standard library. Precede the flag by + to
89 load the described library (or prevent a library from being loaded using nolib). See Apppendix F for
90 information on the provided libraries. 
91
92 .TP 6
93 .B \-nolib 
94 Do not load any library. This prevents the standard library from being loaded. 
95
96 .TP 6
97 .B \-ansi-lib 
98 Use the ANSI standard library (selected by default). 
99
100 .TP 6
101 .B \-strict-lib 
102 Use strict version of the ANSI standard library. 
103
104 .TP 6
105 .B \-posix-lib 
106 Use the POSIX standard library. 
107
108 .TP 6
109 .B \-posix-strict-lib 
110 Use the strict version of the POSIX standard library. 
111
112 .TP 6
113 .B \-1-lib 
114 Use UNIX version of standard library. 
115
116 .TP 6
117 .B \-1-strict-lib 
118 Use the strict version of the UNIX standard library. 
119
120 .PP
121 .B Output
122
123 These flags control what additional information is printed by LCLint. Setting +<flag> causes the described
124 information to be printed; setting -<flag> prevents it. By default, all these flags are off.
125
126 .TP 6
127 .B \-usestderr 
128 Send error messages to standard error (instead of standard out). 
129
130 .TP 6
131 .B \-showsummary 
132 Show a summary of all errors reported and suppressed. Counts of suppressed errors are not
133 necessarily correct since turning a flag off may prevent some checking from being done to save
134 computation, and errors that are not reported may propagate differently from when they are
135 reported. 
136
137 .TP 6
138 .B \-showscan 
139 Show file names are they are processed. 
140
141 .TP 6
142 .B \-showalluses 
143 Show list of uses of all external identifiers sorted by number of uses. 
144
145 .TP 6
146 .B \-stats 
147 Display number of lines processed and checking time. 
148
149 .TP 6
150 .B \-timedist 
151 Display distribution of where checking time is spent. 
152
153 .TP 6
154 .B \-quiet 
155 Suppress herald and error count. (If quiet is not set, LCLint prints out a herald with version
156 information before checking begins, and a line summarizing the total number of errors reported.) 
157
158 .TP 6
159 .B \-whichlib 
160 Print out the standard library filename and creation information. 
161
162 .TP 6
163 .BI \-limit " number"
164 At most <number> similar errors are reported consecutively. Further errors are suppressed, and a
165 message showing the number of suppressed messages is printed. 
166
167 .PP
168 .B Expected Errors
169
170 Normally, LCLint will expect to report no errors. The exit status will be success (0) if no errors are reported,
171 and failure if any errors are reported. Flags can be used to set the expected number of reported errors.
172 Because of the provided error suppression mechanisms, these options should probably not be used for final
173 checking real programs but may be useful in developing programs using make.
174
175 .TP 6
176 .B \-expect <number> 
177 Exactly <number> code errors are expected. LCLint will exit with failure exit status unless
178 <number> code errors are detected. 
179
180 .TP 6
181 .B \-Message Format
182 These flags control how messages are printed. They may be set at the command line, in options files, or
183 locally in syntactic comments. The linelen and limit flags may be preceded by + or - with the same meaning;
184 for the other flags, + turns on the describe printing and - turns it off. The box to the left of each flag gives its
185 default value.
186
187 .TP 6
188 .B \-showcolumn 
189 Show column number where error is found. Default: + 
190
191 .TP 6
192 .B \-showfunc 
193 Show name of function (or macro) definition containing error. The function name is printed once
194 before the first message detected in that function. Default: +
195
196 .TP 6
197 .B \-showallconjs 
198 Show all possible alternate types (see Section 8.2.2). Default: - 
199
200 .TP 6
201 .B \-paren-file-format 
202 Use file(line) format in messages. 
203
204 .TP 6
205 .B \-hints 
206 Provide hints describing an error and how a message may be suppressed for the first error
207 reported in each error class. Default: + 
208
209 .TP 6
210 .B \-forcehints 
211 Provide hints for all errors reported, even if the hint has already been displayed for the same error
212 class. Default: - 
213
214 .TP 6
215 .BI \-linelen " number"
216 Set length of maximum message line to <number> characters. LCLint will split messages longer
217 than <number> characters long into multiple lines. Default: 80 
218
219 .PP
220 .B Mode Selector Flags
221
222 Mode selects flags set the mode checking flags to predefined values. They provide a quick coarse-grain way
223 of controlling what classes of errors are reported. Specific checking flags may be set after a mode flag to
224 override the mode settings. Mode flags may be used locally, however the mode settings will override specific
225 command line flag settings. A warning is produced if a mode flag is used after a mode checking flag has been
226 set. 
227
228 These are brief descriptions to give a general idea of what each mode does. To see the complete flag settings
229 in each mode, use lclint -help modes. A mode flag has the same effect when used with either + or -.
230
231 .TP 6
232 .B \-weak 
233 Weak checking, intended for typical unannotated C code. No modifies checking, macro checking,
234 rep exposure, or clean interface checking is done. Return values of type int may be ignored. The
235 types bool, int, char and user-defined enum types are all equivalent. Old style declarations are
236 unreported. 
237
238 .TP 6
239 .B \-standard 
240 The default mode. All checking done by weak, plus modifies checking, global alias checking, use all
241 parameters, using released storage, ignored return values or any type, macro checking,
242 unreachable code, infinite loops, and fall-through cases. The types bool, int and char are distinct.
243 Old style declarations are reported. 
244
245 .TP 6
246 .B \-checks 
247 Moderately strict checking. All checking done by standard, plus must modification checking, rep
248 exposure, return alias, memory management and complete interfaces. 
249
250 .TP 6
251 .B \-strict 
252 Absurdly strict checking. All checking done by checks, plus modifications and global variables
253 used in unspecified functions, strict standard library, and strict typing of C operators. A special
254 reward will be presented to the first person to produce a real program that produces no errors with
255 strict checking. 
256
257
258 .SH TODO
259 Improve this manpage :-)
260
261 .SH AUTHOR
262 If you need to get in contact with the authors send email to
263 .UR
264 mailto:lclint-bug@cs.virginia.edu
265 .UR
266
267 or visit 
268 .UR
269 http://lclint.cs.virginia.edu
270 .UR
271
272 .SH "SEE ALSO"
273 lint(1)
This page took 0.061422 seconds and 5 git commands to generate.