[splint-discuss] RE: Help on "Storage x may become null" error
Ludolf Holzheid
lholzheid at bihl-wiedemann.de
Fri Apr 20 14:07:47 EDT 2007
On Wed, 2007-04-18 15:59:06 -0700, Keith Prickett wrote:
> [..]
> This may be true, except splint contains about the line where an
> assignment to listOfMyOwnType[0] is occuring.
Hello Keith,
If this is for the source you sent to Bodo Wenzel: You explicitly
annotated listOfMyOwnType as being possibly NULL, so referencing it
_must_ give a warning.
As listOfMyOwnType[2] is of storage class "auto", it will be located
on the stack and thus its address never will be NULL. I think you
wanted to annotate the _elements_ of listOfMyOwnType. Bodo Wenzel
provided a way to accomplish this by means of an intermediate type
definition.
> [..]
> I can't get Splint to recognize my "ASSERT" (instead of using "ifs" like
> above) but that's for a different topic.
I don't know how your "ASSERT" is defined, so I can't say
anything. The C99-macro "assert" (from <assert.h>) seems to work,
however.
HTH,
Ludolf
--
---------------------------------------------------------------
Ludolf Holzheid Tel: +49 621 339960
Bihl+Wiedemann GmbH Fax: +49 621 3392239
Floßwörthstraße 41 e-mail: lholzheid at bihl-wiedemann.de
D-68199 Mannheim, Germany
---------------------------------------------------------------
More information about the splint-discuss
mailing list