> Splint can parse ANSI-C89/ISO-C90 code only, sorry. I sent a patch a few weeks ago that worked around this particular issue.
Michael Wojcik responded with the excellent critique that if splint is otherwise C90 and one change is introduced to make splint silently accept some code that's C99-legal and C90-illegal, that could be considered a false negative. (Thanks!) However, after reading Olivier Faurax's question earlier today, I searched for "splint c99" on google, and found that splint already appears to be a hybrid of c90/c99. For example: 1. search in the change log [http://www.splint.org/changes.html] for C99, to find several changes that cause splint to silently accept parts of c99. 2. The FAQ [http://www.splint.org/faq.html] states: "Splint is independent from your compiler. It checks standard C code, according to the ISO C99 specification. Splint supports most, but not all, of the C99 extensions to the ANSI C." 3. After reading the change log, I built a few sample programs, each of which produced no warnings from splint (run with no arguments besides the file name): /* sample.c, c99-legal, c90-illegal*/ #include <stdio.h> struct evil_struct { int bad_integer; }; int main() { struct evil_struct s = { .bad_integer = 1 }; printf("%d\n", s.bad_integer); return 0; } /* eof */ /* sample2.c, does NOT compile with gcc (missing #include <stdbool.h>) */ /* therefore, splint implicitly understands "bool" as a type! */ #include <stdio.h> int main() { bool x = false; if (x) { printf("true\n"); } else { printf("false\n"); } return 0; } /* eof */ I also found several other messages indicating interest in a fix for this problem (besides the 2 in the past month): http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=369264 http://coding.derkeiler.com/Archive/C_CPP/comp.lang.c/2007-06/msg00917.h tml http://osdir.com/ml/programming.splint.general/2006-08/msg00000.html For these reasons, I submit that splint would become strictly better if it were extended to support this c99-ism, in addition to the others it supports. (Better still would be a cleaner and stricter differentiation of the different flavors of c, selected by a "--std={ansic89|isoc99}" option or something, but that would be more like a project than a patch...) So unless somebody can convince me otherwise, I guess I'm on a quest to find a splint maintainer if he exists, and perhaps get a new patch release out, as time permits. Of course, anyone who likes my patch is welcome to use it, and encouraged to send me feedback :) http://www.cs.virginia.edu/pipermail/splint-discuss/2008-July/001190.htm l _______________________________________________ splint-discuss mailing list splint-discuss@mail.cs.virginia.edu http://www.cs.virginia.edu/mailman/listinfo/splint-discuss