[splint-discuss] splint can't detect the array overflow?

Bin Chen binary.chen at gmail.com
Fri Mar 16 21:08:04 PST 2007


A simple program with splint run with 'splint a.c':

binch at 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 at binch:/tmp$ cat b.c
int b[3];

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

I can't believe that splint can't point out the overflow, maybe I miss 
some argument to invoke splint?
Thanks in advance.

ABAI




More information about the splint-discuss mailing list