2 .TH splint 1 "A tool for statically checking C programs"
5 splint \- A tool for statically checking C programs
13 is a tool for statically checking C programs for security
14 vulnerabilities and common programming mistakes. With minimal effort,
15 Splint can be used as a better lint(1).If additional effort is invested
16 adding annotations to programs, Splint can perform stronger checks than
17 can be done by any standard lint. For full documentation, please see
18 http://www.splint.org. This man page only covers a few of the available
30 These flags control directories and files used by Splint. They may be used from the
31 command line or in an options file, but may not be used as control comments in the
32 source code. Except where noted. they have the same meaning preceded by \- or +.
35 .BI \-tmpdir " directory"
36 Set directory for writing temp files. Default is /tmp/.
40 Add directory to path searched for C include files. Note there is no space after the I,
41 to be consistent with C preprocessor flags.
45 Add directory to path search for .lcl specification files.
49 Load options file <file>. If this flag is used from the command line, the default ~/.splintrc file is
50 not loaded. This flag may be used in an options file to load in another options file.
54 Prevents the default options files (./.splintrc and ~/.splintrc) from being loaded. (Setting
55 -nof overrides +nof, causing the options files to be loaded normally.)
58 .BI \-systemdirs " directories"
59 Set directories for system files (default is "/usr/include"). Separate directories with colons (e.g.,
60 "/usr/include:/usr/local/lib"). Flag settings propagate to files in a system directory. If
61 -systemdirerrors is set, no errors are reported for files in system directories.
66 These flags are used to define or undefine pre-processor constants.
67 The -I<directory> flag is also passed to the C pre-processor.
70 .BI \-D " initializer"
71 Passed to the C pre-processor.
74 .BI \-U " initializer"
75 Passed to the C pre-processor
79 These flags control the creation and use of libraries.
83 Save state in <file> for loading. The default extension .lcd is added if <file> has no extension.
87 Load state from <file> (created by -dump). The default extension .lcd is added if <file> has no
88 extension. Only one library file may be loaded.
90 By default, the standard library is loaded if the -load flag is not used to load a user library. If no user library is
91 loaded, one of the following flags may be used to select a different standard library. Precede the flag by + to
92 load the described library (or prevent a library from being loaded using nolib). See Apppendix F for
93 information on the provided libraries.
97 Do not load any library. This prevents the standard library from being loaded.
101 Use the ANSI standard library (selected by default).
105 Use strict version of the ANSI standard library.
109 Use the POSIX standard library.
112 .B \-posix-strict-lib
113 Use the strict version of the POSIX standard library.
117 Use UNIX version of standard library.
121 Use the strict version of the UNIX standard library.
126 These flags control what additional information is printed by Splint. Setting +<flag> causes the described
127 information to be printed; setting -<flag> prevents it. By default, all these flags are off.
131 Send error messages to standard error (instead of standard out).
135 Show a summary of all errors reported and suppressed. Counts of suppressed errors are not
136 necessarily correct since turning a flag off may prevent some checking from being done to save
137 computation, and errors that are not reported may propagate differently from when they are
142 Show file names are they are processed.
146 Show list of uses of all external identifiers sorted by number of uses.
150 Display number of lines processed and checking time.
154 Display distribution of where checking time is spent.
158 Suppress herald and error count. (If quiet is not set, Splint prints out a herald with version
159 information before checking begins, and a line summarizing the total number of errors reported.)
163 Print out the standard library filename and creation information.
166 .BI \-limit " number"
167 At most <number> similar errors are reported consecutively. Further errors are suppressed, and a
168 message showing the number of suppressed messages is printed.
173 Normally, Splint will expect to report no errors. The exit status will be success (0) if no errors are reported,
174 and failure if any errors are reported. Flags can be used to set the expected number of reported errors.
175 Because of the provided error suppression mechanisms, these options should probably not be used for final
176 checking real programs but may be useful in developing programs using make.
180 Exactly <number> code errors are expected. Splint will exit with failure exit status unless
181 <number> code errors are detected.
185 These flags control how messages are printed. They may be set at the command line, in options files, or
186 locally in syntactic comments. The linelen and limit flags may be preceded by + or - with the same meaning;
187 for the other flags, + turns on the describe printing and - turns it off. The box to the left of each flag gives its
192 Show column number where error is found. Default: +
196 Show name of function (or macro) definition containing error. The function name is printed once
197 before the first message detected in that function. Default: +
201 Show all possible alternate types (see Section 8.2.2). Default: -
204 .B \-paren-file-format
205 Use file(line) format in messages.
209 Provide hints describing an error and how a message may be suppressed for the first error
210 reported in each error class. Default: +
214 Provide hints for all errors reported, even if the hint has already been displayed for the same error
218 .BI \-linelen " number"
219 Set length of maximum message line to <number> characters. Splint will split messages longer
220 than <number> characters long into multiple lines. Default: 80
223 .B Mode Selector Flags
225 Mode selects flags set the mode checking flags to predefined values. They provide a quick coarse-grain way
226 of controlling what classes of errors are reported. Specific checking flags may be set after a mode flag to
227 override the mode settings. Mode flags may be used locally, however the mode settings will override specific
228 command line flag settings. A warning is produced if a mode flag is used after a mode checking flag has been
231 These are brief descriptions to give a general idea of what each mode does. To see the complete flag settings
232 in each mode, use splint -help modes. A mode flag has the same effect when used with either + or -.
236 Weak checking, intended for typical unannotated C code. No modifies checking, macro checking,
237 rep exposure, or clean interface checking is done. Return values of type int may be ignored. The
238 types bool, int, char and user-defined enum types are all equivalent. Old style declarations are
243 The default mode. All checking done by weak, plus modifies checking, global alias checking, use all
244 parameters, using released storage, ignored return values or any type, macro checking,
245 unreachable code, infinite loops, and fall-through cases. The types bool, int and char are distinct.
246 Old style declarations are reported.
250 Moderately strict checking. All checking done by standard, plus must modification checking, rep
251 exposure, return alias, memory management and complete interfaces.
255 Absurdly strict checking. All checking done by checks, plus modifications and global variables
256 used in unspecified functions, strict standard library, and strict typing of C operators. A special
257 reward will be presented to the first person to produce a real program that produces no errors with
261 If you need to get in contact with the authors send email to
262 .UR mailto:info@splint.org
266 .UR http://www.splint.org