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