[splint-discuss] Splint usage help
Marcus Martin
nymaen at yahoo.com
Sat Apr 18 17:48:13 PDT 2009
Brian's suggestion worked perfectly.
typedef /*@null@*/ const char *StringListElement;
StringListElement subCmds[] = { "-file", "-stream", NULL };
Results in no errors.
When I tried Chuck's suggestion, I still got one warning.
const char *subCmds[] = { "-file", "-stream", (const char*)NULL };
test.c: (in function TestMethod)
test.c:103:51: Local subCmds[2] initialized to null value:
subCmds[2] = (const char *)NULL
A reference with no null annotation is assigned or initialized to
NULL. Use
/*@null@*/ to declare the reference as a possibly null pointer. (Use
-nullassign to inhibit warning)
Any ideas on how I misunderstood chuck?
Marcus
More information about the splint-discuss
mailing list