]> andersk Git - splint.git/blob - doc/html/faq.html
Answered some of these questions in more detail.
[splint.git] / doc / html / faq.html
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">
4   <head>
5     <meta name="generator"
6     content="HTML Tidy for Linux/x86 (vers 1st November 2002), see www.w3.org" />
7     <link rel="stylesheet" type="text/css" href="http://www.splint.org/splint.css"
8     title="style1" />
9     <title>Splint FAQ</title>
10   </head>
11   <body>
12     <!--#include virtual="header.html"-->
13     <h1>Splint - Frequently Asked Questions</h1>
14     <h3>Index</h3>
15     <ol>
16         <h4><a href="#genquest">General Questions About Splint</a></h4>
17       <li><a href="#quest1">What is the difference between Splint and LCLint?</a><br />
18       </li>
19       <li><a href="#quest2">What is the Splint logo?<br />
20       </a></li>
21       <li><a href="#quest3">Can I include Splint in my software distribution?<br />
22       </a></li>
23       <li><a href="#quest4">Can we use your software in our company? (We are not a GNU
24       organization.)<br />
25       </a></li>
26       <li><a href="#quest9">Which compilers does Splint support?<br />
27       </a></li>
28       <li><a href="#quest5">Does Splint handle C++?<br />
29       </a></li>
30         <h4><a href="#install">Installation</a></h4>
31       </li>
32       <li><a href="#quest6">I downloaded the Splint .tgz file but can't figure out how to
33       extract it. There is no 'z' option on the tar on my system.<br />
34       </a></li>
35       <li><a href="#quest7">I want to use Splint in Windows. How do I do that?<br />
36       </a></li>
37       <li><a href="#quest8">I have installed Splint for Windows 2000. Where should I put
38       the ".splintrc" file?<br />
39       </a></li>
40       <li><a href="#quest17">When I build Splint I get the following errors.... Should I
41       be worried?<br />
42       </a></li>
43       <li><a href="#quest18">I just installed Splint on a new machine. I get a bunch of
44       errors during building when the test suite is run. When I look through the results,
45       it seems like Splint is not reporting any errors in the code it analyzes. What is
46       going on?<br />
47       </a></li>
48         <h4><a href="#usage">Usage</a></h4>
49       <li><a href="#quest15">I heard that we will get lot of parse errors when we run
50       this tool first time. Hence we need to modify source code. Is it correct ?<br />
51       </a></li>
52       <li><a href="#quest16">I heard that Splint can generate some spurious errors ( not
53       genuine errors). Is it correct ?<br />
54       </a></li>
55       <li><a href="#quest10">How does Splint handle const?<br />
56       </a></li>
57       <li><a href="#quest14">I develop code on an embedded system with a compiler that
58       uses nonstandard key words and data types. I would like to run Splint on my code
59       but these nonstandard keywords cause parse errors. What should I do?<br />
60       </a></li>
61       <li><a href="#quest14b">How can I get Splint to recognize directory trees and local
62       source include directories?<br />
63       </a></li>
64       <li><a href="#quest20">I use realloc in my code. How can I get Splint in check this
65       code more effectively?<br />
66       </a></li>
67         <h4><a href="#warnerror">Warnings and Errors</a></h4>
68       <li><a href="#quest11">Why do I get a warning when multiplying different integer
69       types? The C standard says this is ok. Why is this wrong?<br />
70       </a></li>
71       <li><a href="#quest12">The C standard says that what I'm doing is okay. Why does
72       Splint give me a warning?<br />
73       </a></li>
74       <li><a href="#quest13">Splint complains if I ignore the return value of scanf but
75       not printf?<br />
76       </a></li>
77       <li><a href="#quest18b">I get parse errors when I try to run Splint on code like
78       #define MACROdebug(...) blahblah . Can I use variadic macros in Splint?<br />
79       </a></li>
80         <h4><a href="#bugs">Bugs</a></h4>
81       <li><a href="#quest21">I think I've found a bug in Splint. What should I do?<br />
82      </a></li>
83        <li><a href="#quest22">Splint tells me that there is a bug and I should report it.
84       What information should I send?<br />
85       </a></li>
86                <h4><a href="#adinfo">Additional Information</a></h4>
87       <li><a href="#quest23">My question isn't answered here. How can I get more
88       information about Splint?<br />
89       </a></li>
90     </ol>
91     <h3>Questions and Answers</h3>
92     <ol>
93         <h4><a id="genquest" name="genquest">General Questions About Splint</a></h4>
94       <li>
95         <p><a id="quest1" name="quest1">What is the difference between Splint and
96         LCLint?</a></p>
97         <p>Before 2002, Splint was known as LCLint. Splint 3.0 is the successor to LCLint
98         2.5.</p>
99         <blockquote>
100           LCLint was originally named for LCL, the Larch C Interface Language and lint, a
101           well-known C program checking tool. Because our tool has diverged from LCL, and
102           our focus now is on secure programming, it was renamed Splint. Splint's name
103           has (at least) three interpretations: specifications lint, secure programming
104           lint, and first aid for programmers. It's also easier to pronounce than
105           LCLint.<br />
106           <br />
107         </blockquote>
108       </li>
109       <li>
110         <p><a id="quest2" name="quest2">What is the Splint logo?</a></p>
111         <blockquote>
112           Thomas Jefferson's Serpentine Walls at the University of Virginia. The walls
113           are one brick thick, but because of their design are both strong and aesthetic.
114           Like a secure program, secure walls depend on sturdy bricks, solid
115           construction, and elegant and principled design.<br />
116           <br />
117         </blockquote>
118       </li>
119       <li>
120         <p><a id="quest3" name="quest3">Can I include Splint in my software
121         distribution?</a></p>
122         <blockquote>
123           Yes. Splint is licensed under the GNU General Public License. You may
124           redistribute it as you wish so long as credits and pointers to <a
125           href="http://www.splint.org/">www.splint.org</a> are not changed or removed.
126           Splint may be included in commercial distributions, and is included in several
127           Linux and freeware CDs. If you redistribute Splint, please let us know by
128           sending a message to <a
129           href="mailto:splint@cs.virginia.edu">splint@cs.virginia.edu</a>.<br />
130           <br />
131         </blockquote>
132       </li>
133       <li>
134         <p><a id="quest4" name="quest4">Can we use your software in our company? (We are
135         not a GNU organization.)</a></p>
136         <blockquote>
137           Yes, splint is GPL-licensed. Anyone may use it. If you want to redistribute it,
138           check the license for details or contact us.<br />
139           <br />
140         </blockquote>
141       </li>
142       <li>
143         <p><a id="quest9" name="quest9">Which compilers does Splint support?</a></p>
144         <blockquote>
145           Splint is independent from your compiler.  It should be able to handle code written for any compiler as long as the code is C99 compliant. <br />
146           <br />
147         </blockquote>
148       </li>
149       <li>
150         <p><a id="quest5" name="quest5">Does Splint handle C++?</a></p>
151         <blockquote>
152           No. Splint handles ISO C99 (and some gcc extensions if +gnuextensions is used).
153           We don't have the resources (or the research justification) to build a C++
154           front end, but if you are interested in building a C++ front end the source
155           code is available, and I will certainly be willing to help.<br />
156           <br />
157         </blockquote>
158       </li>
159         <h4><a id="install" name="install">Installation</a></h4>
160       <li>
161         <p><a id="quest6" name="quest6">I downloaded the Splint .tgz file but can't
162         figure out how to extract it. There is no 'z' option on the tar on my
163         system.</a></p>
164         <blockquote>
165           Check to see if there is GNU tar on your system, it is usually invoked by the
166           command gtar or gnutar. GNU tar supports the -z option.<br />
167           <br />
168            
169           <p>You can also unzip the file then untar it. Do: gunzip filename.tar.gz to
170           unzip then tar -xvf filename.tar</p>
171         </blockquote>
172       </li>
173       <li>
174         <p><a id="quest7" name="quest7">I want to use Splint in Windows. How do I do
175         that?</a></p>
176         <blockquote>
177           See <a href="http://splint.org/win32.html/">http://splint.org/win32.html</a> for instructions on obtaining and installing Splint on Windows.<br />
178           <br />
179         </blockquote>
180       </li>
181       <li>
182         <p><a id="quest8" name="quest8">I have installed Splint for Windows 2000. Where
183         should I put the ".splintrc" file?</a></p>
184         <blockquote>
185           For Win32, Splint looks for splint.rc instead of .splintrc due to the DOS
186           filename problems. It will look first in the current directory, then in           
187           your home directory. See the Splint manual for more information.<br / >
188         </blockquote>
189       </li>
190       <li>
191         <p><a id="quest17" name="quest17">When I build Splint I get the following
192         error:</a></p>
193         <blockquote>
194           Checking for...<br />
195           <br />
196            
197           <p>Checking manual...</p>
198           <p>cmx &gt; / Checking tests2.2...</p>
199           <p>Checking tests2.4...</p>
200           <p>Checking tests2.5...</p>
201           <p>Checking db1...</p>
202           <p>0a1,2</p>
203           <p>&gt; /cmx/tools/make -e clean</p>
204           <p>&gt; /cmx/tools/make -e check</p>
205           <p>*** FAIL ***</p>
206           <p>Checking db2...</p>
207           <p>0a1,/tools/make -e clean</p>
208           <p>&gt; /cmx/tools/make -e check</p>
209           <p>*** FAIL ***</p>
210           <p>Checking db3...</p>
211         </blockquote>
212         <p>Should I be worried?</p>
213         <blockquote>
214           Those diffs look harmless. It is likely that your make is set up slightly
215           differently than ours.<br />
216           <br />
217         </blockquote>
218       </li>
219       <li>
220         <p><a id="quest18" name="quest18">I just installed Splint on a new machine. I get
221         a bunch of errors during building when the test suite is run. When I look through
222         the results, it seems like Splint is not reporting any errors in the code it
223         analyzes. What is going on?</a></p>
224         <blockquote>
225           One possibility is that the installation directory where the test suite is
226           running is on the system path (hence, splint won't report errors if
227           -sysdirerrors is set, as it is by default). Try adding +sysdirerrors to the
228           command line for the test suite to see if that is the problem, or installing
229           Splint in a different directory not in the system path.<br />
230           <br />
231         </blockquote>
232       </li>
233         <h4><a id="usage" name="usage">Usage</a></h4>
234       <li>
235         <p><a id="quest15" name="quest15">I heard that we will get lot of parse errors
236         when we run this tool first time. Hence we need to modify source code. Is it
237         correct ?</a></p>
238         <blockquote>
239         Usually not.<br />
240         Parse errors usually occur in code written for compilers that use nonstandard keywords. (See the <a href="#quest14">question</a> on using Splint for code development on embedded systems.)<br />
241
242         If you're getting parse errors make sure that the required libraries are included by using the +posixlib or +unixlib flags.  If you're using nonstandard gnu extensions the +gnuextensions flag make be helpful.<br />
243
244        However, Splint doesn't yet support all C99 extensions so there are some legitimate C programs that will need to be modified.<br />
245           <br />
246         </blockquote>
247       </li>
248       <li>
249         <p><a id="quest16" name="quest16">I heard that Splint can generate some spurious
250         errors ( not genuine errors). Is it correct ?</a></p>
251         <blockquote>
252
253           Yes.  Many of the program properties that Splint checks are undecidable.  This means that any static analysis tool that can be run on real programs will either produce false positives or false negatives. Because
254 of this and to improve efficiency, Splint makes some simplifying assumptions.  This means
255 that Splint will occasionally produce spurious warnings or miss real errors.<br />
256
257 However, often spurious errors can be fixed by adding additional annotations.<br />
258         </blockquote>
259       </li>
260       <li>
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>
269       <li>
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>
291       <li>
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>
294         <blockquote>
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 />
297           <br />
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>
304         </blockquote>
305       </li>
306         <h4><a id="warnerror" name="warnerror">Warnings and Errors</a></h4>
307       <li>
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>
311         <blockquote>
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 />
315           <br />
316         </blockquote>
317       </li>
318       <li>
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>
321         <blockquote>
322           See the previous question.<br />
323           <br />
324         </blockquote>
325       </li>
326       <li>
327         <p><a id="quest13" name="quest13">Splint complains if I ignore the return value
328         of scanf but not printf?</a></p>
329         <blockquote>
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 />
333           <br />
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>
340         </blockquote>
341       </li>
342       <li>
343         <p><a id="quest18b" name="quest18b">I get parse errors when I try to run Splint
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>
352         <h4><a id="bugs" name="bugs">Bugs</a></h4>
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>
376         <h4><a id="adinfo" name="adinfo">Additional Information</a></h4>
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"-->
397   </body>
398 </html>
This page took 0.067824 seconds and 5 git commands to generate.