]> andersk Git - splint.git/blame - doc/html/faq.html
Indexed faq.html
[splint.git] / doc / html / faq.html
CommitLineData
e63e0a4a 1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
112c85fd 4 <head>
5 <meta name="generator"
6 content="HTML Tidy for Linux/x86 (vers 1st November 2002), see www.w3.org" />
e63e0a4a 7 <link rel="stylesheet" type="text/css" href="http://www.splint.org/splint.css"
8 title="style1" />
9 <title>Splint FAQ</title>
112c85fd 10 </head>
e63e0a4a 11 <body>
12 <!--#include virtual="header.html"-->
6252ab26 13 <h1>Splint - Frequently Asked Questions</h1>
e63e0a4a 14 <h3>Index</h3>
15
16 <ol>
96c3605a 17 <a href="#genquest"><h4>General Questions About Splint</h4></a>
e63e0a4a 18 <li>
19 <a href="#quest1">
20 What is the difference between Splint and LCLint?</a><br />
21 </li>
22 <li><a href="#quest2">What is the Splint logo?<br />
112c85fd 23 </a></li>
e63e0a4a 24 <li><a href="#quest3">Can I include Splint in my software distribution?<br />
112c85fd 25 </a></li>
e63e0a4a 26 <li><a href="#quest4">Can we use your software in our company? (We are not a GNU
27 organization.)<br />
96c3605a 28 </a></li>
29 <li><a href="#quest9">Which compilers does Splint support?<br />
112c85fd 30 </a></li>
e63e0a4a 31 <li><a href="#quest5">Does Splint handle C++?<br />
112c85fd 32 </a></li>
e63e0a4a 33
96c3605a 34 <a href="#install"><h4> Installation</h4></a>
e63e0a4a 35 <li><a href="#quest6">I downloaded the Splint .tgz file but can't figure out how to
36 extract it. There is no 'z' option on the tar on my system.<br />
112c85fd 37 </a></li>
e63e0a4a 38 <li><a href="#quest7">I want to use Splint in win2000. How do I do that?<br />
112c85fd 39 </a></li>
e63e0a4a 40 <li><a href="#quest8">I have installed Splint for Windows 2000. Where should I put
41 the ".splintrc" file?<br />
112c85fd 42 </a></li>
96c3605a 43 <li><a href="#quest17">When I build Splint I get the following errors.... Should I be worried?<br />
112c85fd 44 </a></li>
96c3605a 45 <li><a href="#quest18">I just installed Splint on a new machine. I get a bunch of
46 errors during building when the test suite is run. When I look through the results,
47 it seems like Splint is not reporting any errors in the code it analyzes. What is
48 going on?<br />
112c85fd 49 </a></li>
96c3605a 50 <a href="#usage"><h4>Usage</h4></a>
51 <li><a href="#quest15">I heard that we will get lot of parse errors when we run
52 this tool first time. Hence we need to modify source code. Is it correct ?<br />
112c85fd 53 </a></li>
96c3605a 54 <li><a href="#quest16">I heard that Splint can generate some spurious errors ( not
55 genuine errors). Is it correct ?<br />
112c85fd 56 </a></li>
96c3605a 57 <li><a href="#quest10">How does Splint handle const?<br />
112c85fd 58 </a></li>
96c3605a 59 <li><a href="#quest14">I develop code on an embedded system with a compiler that
e63e0a4a 60 uses nonstandard key words and data types. I would like to run Splint on my code
61 but these nonstandard keywords cause parse errors. What should I do?<br />
112c85fd 62 </a></li>
e63e0a4a 63 <li><a href="#quest14b">How can I get Splint to recognize directory trees and local
64 source include directories?<br />
112c85fd 65 </a></li>
96c3605a 66
67 <li><a href="#quest20">I use realloc in my code. How can I get Splint in check this
68 code more effectively?<br />
112c85fd 69 </a></li>
96c3605a 70
71 <a href="#warnerror"><h4>Warnings and Errors</h4></a>
72 <li><a href="#quest11">Why do I get a warning when multiplying different integer
73 types? The C standard says this is ok. Why is this wrong?<br />
112c85fd 74 </a></li>
96c3605a 75 <li><a href="#quest12">The C standard says that what I'm doing is okay. Why does
76 Splint give me a warning?<br />
112c85fd 77 </a></li>
96c3605a 78 <li><a href="#quest13">Splint complains if I ignore the return value of scanf but
79 not printf?<br />
112c85fd 80 </a></li>
e63e0a4a 81 <li><a href="#quest18b">I get parse errors when I try to run Splint on code like
82 #define MACROdebug(...) blahblah . Can I use variadic macros in Splint?<br />
112c85fd 83 </a></li>
96c3605a 84 <a href="#bugs"><h4>Bugs</h4></a>
e63e0a4a 85 <li><a href="#quest21">I think I've found a bug in Splint. What should I do?<br />
112c85fd 86 </a></li>
e63e0a4a 87 <li><a href="#quest22">Splint tells me that there is a bug and I should report it.
88 What information should I send?<br />
112c85fd 89 </a></li>
96c3605a 90 <a href="#adinfo"> <h4>Additional Information</h4></a>
e63e0a4a 91 <li><a href="#quest23">My question isn't answered here. How can I get more
92 information about Splint?<br />
112c85fd 93 </a></li>
94 </ol>
112c85fd 95 <h3>Questions and Answers</h3>
96 <ol>
96c3605a 97 <a id="genquest" name="genquest"><h4>General Questions About Splint</h4>
e63e0a4a 98 <li>
99 <p><a id="quest1" name="quest1">What is the difference between Splint and
100 LCLint?</a></p>
101 <p>Before 2002, Splint was known as LCLint. Splint 3.0 is the successor to LCLint
102 2.5.</p>
103 <blockquote>
104 LCLint was originally named for LCL, the Larch C Interface Language and lint, a
105 well-known C program checking tool. Because our tool has diverged from LCL, and
106 our focus now is on secure programming, it was renamed Splint. Splint's name
107 has (at least) three interpretations: specifications lint, secure programming
108 lint, and first aid for programmers. It's also easier to pronounce than
109 LCLint.<br />
110 <br />
111 </blockquote>
112 </li>
113 <li>
114 <p><a id="quest2" name="quest2">What is the Splint logo?</a></p>
115 <blockquote>
116 Thomas Jefferson's Serpentine Walls at the University of Virginia. The walls
117 are one brick thick, but because of their design are both strong and aesthetic.
118 Like a secure program, secure walls depend on sturdy bricks, solid
119 construction, and elegant and principled design.<br />
120 <br />
121 </blockquote>
122 </li>
123 <li>
124 <p><a id="quest3" name="quest3">Can I include Splint in my software
125 distribution?</a></p>
126 <blockquote>
127 Yes. Splint is licensed under the GNU General Public License. You may
128 redistribute it as you wish so long as credits and pointers to <a
129 href="http://www.splint.org/">www.splint.org</a> are not changed or removed.
130 Splint may be included in commercial distributions, and is included in several
131 Linux and freeware CDs. If you redistribute Splint, please let us know by
132 sending a message to <a
133 href="mailto:splint@cs.virginia.edu">splint@cs.virginia.edu</a>.<br />
134 <br />
135 </blockquote>
136 </li>
137 <li>
138 <p><a id="quest4" name="quest4">Can we use your software in our company? (We are
139 not a GNU organization.)</a></p>
140 <blockquote>
141 Yes, splint is GPL-licensed. Anyone may use it. If you want to redistribute it,
142 check the license for details or contact us.<br />
143 <br />
144 </blockquote>
145 </li>
112c85fd 146
e63e0a4a 147 <li>
148 <p><a id="quest9" name="quest9">Which compilers does Splint support?</a></p>
149 <blockquote>
150 It is independent from your compiler.<br />
151 <br />
152 </blockquote>
153 </li>
6252ab26 154
e63e0a4a 155 <li>
156 <p><a id="quest5" name="quest5">Does Splint handle C++?</a></p>
157 <blockquote>
158 No. Splint handles ISO C99 (and some gcc extensions if +gnuextensions is used).
159 We don't have the resources (or the research justification) to build a C++
160 front end, but if you are interested in building a C++ front end the source
161 code is available, and I will certainly be willing to help.<br />
162 <br />
163 </blockquote>
164 </li>
96c3605a 165 <a id="install" name="install"><h4>Installation</h4>
e63e0a4a 166 <li>
167 <p><a id="quest6" name="quest6">I downloaded the Splint .tgz file but can't
168 figure out how to extract it. There is no 'z' option on the tar on my
169 system.</a></p>
170 <blockquote>
171 Check to see if there is GNU tar on your system, it is usually invoked by the
172 command gtar or gnutar. GNU tar supports the -z option.<br />
173 <br />
174
175 <p>You can also unzip the file then untar it. Do: gunzip filename.tar.gz to
176 unzip then tar -xvf filename.tar</p>
177 </blockquote>
178 </li>
179 <li>
180 <p><a id="quest7" name="quest7">I want to use Splint in win2000. How do I do
181 that?</a></p>
182 <blockquote>
183 See <a href="http://www.splint.org/">www.splint.org</a> for information on
184 Splint.<br />
185 <br />
186
187 <p><a
188 href="http://www.splint.org/win32.html">http://www.splint.org/win32.html</a>
189 for Windows instructions.</p>
190 </blockquote>
191 </li>
192 <li>
193 <p><a id="quest8" name="quest8">I have installed Splint for Windows 2000. Where
194 should I put the ".splintrc" file?</a></p>
195 <blockquote>
196 For Win32, Splint looks for splint.rc instead of .splintrc due to the DOS
197 filename problems. It will look first in the current directory, then in<br />
198 <br />
199
200 <p>your home directory. See the Splint manual for more information.</p>
201 </blockquote>
202 </li>
96c3605a 203
e63e0a4a 204 <li>
96c3605a 205 <p><a id="quest17" name="quest17">When I build Splint I get the following
206 error:</a></p>
e63e0a4a 207 <blockquote>
96c3605a 208 Checking for...<br />
209 <br />
210
211 <p>Checking manual...</p>
212 <p>cmx &gt; / Checking tests2.2...</p>
213 <p>Checking tests2.4...</p>
214 <p>Checking tests2.5...</p>
215 <p>Checking db1...</p>
216 <p>0a1,2</p>
217 <p>&gt; /cmx/tools/make -e clean</p>
218 <p>&gt; /cmx/tools/make -e check</p>
219 <p>*** FAIL ***</p>
220 <p>Checking db2...</p>
221 <p>0a1,/tools/make -e clean</p>
222 <p>&gt; /cmx/tools/make -e check</p>
223 <p>*** FAIL ***</p>
224 <p>Checking db3...</p>
225 </blockquote>
226 <p>Should I be worried?</p>
227 <blockquote>
228 Those diffs look harmless. It is likely that your make is set up slightly
229 differently than ours.<br />
e63e0a4a 230 <br />
231 </blockquote>
232 </li>
233 <li>
96c3605a 234 <p><a id="quest18" name="quest18">I just installed Splint on a new machine. I get
235 a bunch of errors during building when the test suite is run. When I look through
236 the results, it seems like Splint is not reporting any errors in the code it
237 analyzes. What is going on?</a></p>
e63e0a4a 238 <blockquote>
96c3605a 239 One possibility is that the installation directory where the test suite is
240 running is on the system path (hence, splint won't report errors if
241 -sysdirerrors is set, as it is by default). Try adding +sysdirerrors to the
242 command line for the test suite to see if that is the problem, or installing
243 Splint in a different directory not in the system path.<br />
e63e0a4a 244 <br />
245 </blockquote>
246 </li>
96c3605a 247 <a id="usage" name="usage"><h4>Usage</h4>
248 <li>
249 <p><a id="quest15" name="quest15">I heard that we will get lot of parse errors
250 when we run this tool first time. Hence we need to modify source code. Is it
251 correct ?</a></p>
e63e0a4a 252 <blockquote>
96c3605a 253 Usually not, but Splint doesn't support all C99 extensions.<br />
e63e0a4a 254 <br />
255 </blockquote>
256 </li>
257 <li>
96c3605a 258 <p><a id="quest16" name="quest16">I heard that Splint can generate some spurious
259 errors ( not genuine errors). Is it correct ?</a></p>
e63e0a4a 260 <blockquote>
96c3605a 261 Yes, please see <a href="http://www.splint.org/">www.splint.org</a> for
262 details.<br />
e63e0a4a 263 <br />
e63e0a4a 264 </blockquote>
265 </li>
266 <li>
96c3605a 267 <p><a id="quest10" name="quest10">How does Splint handle const?</a></p>
268 <blockquote>
269 Splint doesn't interpret const (at all). See the manual section on modifies
270 checking (<a
271 href="http://www.splint.org/manual/html/sec7.html">http://www.splint.org/manual/html/sec7.html</a>).<br />
272 <br />
273 </blockquote>
274 </li>
275 <li>
e63e0a4a 276 <p><a id="quest14" name="quest14">I develop code on an embedded system with a
277 compiler that uses nonstandard key words and data types. I would like to run
278 Splint on my code but these nonstandard keywords cause parse errors. What should
279 I do?</a></p>
280 <blockquote>
281 <p>You can often use -D to solve this problem.</p>
282 <p>If you just want to ignore a keyword, you can add -Dnonstandardkeyword= to
283 make the preprocessor eliminate the keyword, where nonstandardkeyword is the
284 name of the keyword. Similarly, you can use -Dspecialtype=int to make a custom
285 type parse as an int.</p>
286 </blockquote>
287 </li>
288 <li>
289 <p><a id="quest14b" name="quest14b">How can I get Splint to recognize directory
290 trees and local source include directories? I've tried putting them in my path
291 but it doesn't seem to look beyond the current directory.</a></p>
292 <blockquote>
293 You can use -I to set the include path like you would with a compiler.<br />
294 <br />
295 </blockquote>
296 </li>
96c3605a 297 <li>
298 <p><a id="quest20" name="quest20">I use realloc in my code. How can I get Splint
299 in check this code more effectively?</a></p>
e63e0a4a 300 <blockquote>
96c3605a 301 realloc has complicated semantics that make it difficult to use correctly. Make
302 sure that you understand realloc and that you really need to use it.<br />
e63e0a4a 303 <br />
96c3605a 304
305 <p>If you decide to use realloc, we recommend that you wrapper it. The document
306 Using Wrapper Functions explains how to do this. That document is included in
307 the Splint documentation and is also available at:</p>
308 <p><a
309 href="http://www.splint.org/documentation/realloc.htm">http://www.splint.org/documentation/realloc.htm</a></p>
e63e0a4a 310 </blockquote>
311 </li>
96c3605a 312 <a id="warnerror" name="warnerror"><h4>Warnings and Errors</h4>
e63e0a4a 313 <li>
96c3605a 314 <p><a id="quest11" name="quest11">Why do I get a Warning when multiplying
315 different integer types? The C standard says this is ok. Why is this
316 wrong?</a></p>
e63e0a4a 317 <blockquote>
96c3605a 318 There are lots of things that the C spec allows and defines clearly, that
319 Splint will provide warnings for. It's not a question of it being "wrong", it's
320 a matter of it being likely to reveal a programming mistake.<br />
e63e0a4a 321 <br />
322 </blockquote>
323 </li>
324 <li>
96c3605a 325 <p><a id="quest12" name="quest12">The C standard says that what I'm doing is
326 okay. Why does Splint give me a warning?</a></p>
e63e0a4a 327 <blockquote>
96c3605a 328 See the previous question.<br />
e63e0a4a 329 <br />
330 </blockquote>
331 </li>
332 <li>
96c3605a 333 <p><a id="quest13" name="quest13">Splint complains if I ignore the return value
334 of scanf but not printf?</a></p>
e63e0a4a 335 <blockquote>
96c3605a 336 This is just a strategic decision --- we view ignoring the result of a scanf to
337 be more likely to reveal a problem with the code than ignoring the result of a
338 printf, even though strict programmers will want to check printf also.<br />
e63e0a4a 339 <br />
96c3605a 340
341 <blockquote>
342 If you want stricter checking, use the flags +ansistrictlib, +posixstrictlib,
343 +unixstrictlib to select the strict versions of these libraries.<br />
344 <br />
345 </blockquote>
e63e0a4a 346 </blockquote>
347 </li>
96c3605a 348 <li><p><a id="quest18b" name="quest18b">I get parse errors when I try to run Splint
e63e0a4a 349 on code like #define MACROdebug(...) blahblah . Can I use variadic macros in
350 Splint?</a></p>
351 <blockquote>
352 Sorry, Splint does not yet support variadic macros. We hope to fix this in a
353 future release.<br />
354 <br />
355 </blockquote>
356 </li>
96c3605a 357
358 <a id="bugs" name="bugs"><h4>Bugs</h4>
e63e0a4a 359 <li>
360 <p><a id="quest21" name="quest21">I think I've found a bug in Splint. What should
361 I do?</a></p>
362 <blockquote>
363 See <a
364 href="http://www.splint.org/bugs.html">http://www.splint.org/bugs.html</a> for
365 a list of known bugs and instructions on reporting bugs.<br />
366 <br />
367 </blockquote>
368 </li>
369 <li>
370 <p><a id="quest22" name="quest22">Splint tells me that there is a bug and I
371 should report it. What information should I send?</a></p>
372 <blockquote>
373 Ideally we would like enough code to reproduce the problem. Small snippets of
374 code which trigger the bug are the best but more code is also acceptable.<br />
375 <br />
376
377 <p>If we're not able to reproduce the problem, then we are unlikely to be able
378 to patch Splint. However, we would still appreciate hearing about the bug and
379 may be able to at least to offer you advice on working around the problem.</p>
380 </blockquote>
381 </li>
96c3605a 382 <a id="adinfo" name="adinfo"><h4>Additional Information</h4>
e63e0a4a 383 <li>
384 <p><a id="quest23" name="quest23">My question isn't answered here. How can I get
385 more information about Splint?</a></p>
386 <blockquote>
387 First check the Splint manual and the mailing list archives.<br />
388 <br />
389
390 <p>The Splint manual is available at: <a
391 href="http://www.splint.org/manual/l">http://www.splint.org/manual/</a></p>
392 <p>The mailing list archives are at:</p>
393 <p><a
394 href="http://www.mail-archive.com/lclint-interest@virginia.edu/u">http://www.mail-archive.com/lclint-interest%40virginia.edu/</a></p>
395 <p>If you're still unable to find the information to answer your question, you
396 can try posting the question to the splint-discuss mailing list (see <a
397 href="http://www.splint.org/lists.html">http://www.splint.org/lists.html</a>)</p>
398 <p>You can also email us at splint@splint.org.</p>
399 </blockquote>
400 </li>
401 </ol>
402 <!--#include virtual="footer.html"-->
112c85fd 403 </body>
404</html>
This page took 0.146643 seconds and 5 git commands to generate.