[splint-discuss] Using /*@null@*/

Michael Wojcik Michael.Wojcik at MicroFocus.com
Wed Apr 23 05:59:24 PDT 2008


> From: splint-discuss-bounces at cs.virginia.edu 
> [mailto:splint-discuss-bounces at cs.virginia.edu] On Behalf Of 
> Michael Wojcik
> Sent: Tuesday, 22 April, 2008 18:17
> 
> Put the annotation before the declaration of the pointer-type 
> field that can be null:
> 
> -----
> #include <stdio.h>
> 
> typedef struct {
>    /*@null@*/ FILE *foo;
>    int bar;
>    int baz;
> } foo_t;
> 
> foo_t foo = { NULL, 0, 0xffffffff };
> -----
> 
> That suppresses the null-assignment warning and parses successfully.

Hmm. I missed the statement in your initial note that said you tried
this and it "does not make splint happy". What didn't work? In my tests
that properly annotated the pointer as allowing a null value.

-- 
Michael Wojcik
Principal Software Systems Developer, Micro Focus



More information about the splint-discuss mailing list