Is splint the best for static code checking? I mean free.



But I have some doubts, such as following code checked by splint:

binch@binch:/tmp$ splint b.c
Splint 3.1.1 --- 20 Jun 2006

b.c: (in function main)
b.c:6:2: Path with no return in function declared to return int
There is a path through a function declared to return a value on
which there
is no return statement. This means the execution may fall through
without
returning a meaningful result to the caller. (Use -noret to inhibit
warning)
b.c:1:5: Variable exported but not used outside b: b
A declaration is exported, but not used outside this module.
Declaration can
use static qualifier. (Use -exportlocal to inhibit warning)

Finished checking --- 2 code warnings
binch@binch:/tmp$ cat b.c
int b[3];

main()
{
b[8] = 5;
}

It can't figure out the array overflow access. Any other choice to
splint? I need a free one. Thanks.
abai

.



Relevant Pages

  • Re: what does "for( ; ; )" mean in C program
    ... Splint is an example of this: ... Test expression type is not boolean or int. ... Finished checking --- 1 code warning ... considering I've dealt with perfectly legitimate C code causing assertion ...
    (comp.lang.c)
  • Re: Question about a splint diagnostic
    ... When I issue "splint u1.c u2.c" I get ... Finished checking --- 1 code warning ... typedef extern int Q; ... that this happens because one only links with the libraries ...
    (comp.lang.c)
  • Re: Question about a splint diagnostic
    ... When I issue "splint u1.c u2.c" I get ... Finished checking --- 1 code warning ... typedef extern int Q; ... that this happens because one only links with the libraries ...
    (comp.lang.c)
  • Re: sizeof A
    ... Then Splint is, quite simply, wrong. ... A character constant is used as an int. ... (Use -boolops to inhibit warning) ...
    (comp.lang.c)
  • Re: lint warning
    ... So that I wrote simple c program as mentioned bellow ... to put up with in splint. ... PC-lint is worth the money if you are serious about ...
    (comp.lang.c)