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