I'm having a problem with getting splint to check some code like the 
following:

1.  if (p) {
2.      if (p->a) {
3.          p->a->b=1;
4.          if (p->a->c) {
5.              bar(p->a);
6.              p->a=NULL;
7.          } else {
8.              foo(p->a);
9.          }
10.     }
11. }

Forgetting other warnings to do with kept storage etc, splint comes up 
with an error like:

Possibly null storage p->a passed as non-null param: foo (p->a)

If I comment out line 6, the warning goes away. It also goes away if I 
comment out lines 4,5,6,7, & 9.

One workaround is to add an assert(NULL!=p->a) between 7 & 8, but is 
there a proper solution?

Thanks,

-C

p.s. This is the Win32 version, Win2k sp2, splint 3.0.1.6


Reply via email to