From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 Description of problem: this is NOT to report a problem in splint but to report a problem that splint has identified. It seems that /usr/include/syslog.h is missing a definition for "_gnuc_va_list" in the function #ifdef __USE_BSD extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap) #endif The only place I could find __gnuc_va_list defined was in /usr/include/err.h If this file is included in the client sourece file then the error message generated by splint evaporate. Version-Release number of selected component (if applicable): syslog version @(#)syslog.h 8.1 (Berkeley) 6/2/93 How reproducible: Always Steps to Reproduce: 1) write a test C source file called: t.c #include <stdarg.h> #include <syslog.h> int main() { return 0 ; } 2) Now run splint splint t.c Splint 3.0.1.7 --- 24 Jan 2003 /usr/include/sys/syslog.h:187:66: Parse Error: Inconsistent function parameter syntax: __gnuc_va_list : <any>. (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. 3) Edit t.c add a line to the top of the file #include <err.h> so the file now reads: #include <err.h> #include <stdarg.h> #include <syslog.h> int main() { return 0 ; } 4) re-run splint: splint t.c Splint 3.0.1.7 --- 24 Jan 2003 Finished checking --- no warnings Expected Results: I would expect that given the first source file the result would be the same as the one with the modification. split would return Splint 3.0.1.7 --- 24 Jan 2003 Finished checking --- no warnings Additional info: There would seem to be 4 possible fixes: 1)alter __gnuc_va_list to "__ptr_t" or "va_list" in the prototype vsyslog(... 2) add the definition int the syslog.h #ifndef __gnuc_va_list #define __gnuc_va_list __ptr_t #endif but with will cause problems if err.h is inclded after syslog in an application source file. 3) Add the definition in to <feature.h> as they both include that file. err.h will need to be modified 4) Include it in another file and include that in to err.h syslog.h 5) #include <err.h> into <syslog.h>
This is gcc, so you need to also look in /usr/lib/gcc-lib: $ pwd /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/include $ grep gnuc_va_list * stdarg.h:/* Define __gnuc_va_list. */ stdarg.h:typedef __builtin_va_list __gnuc_va_list; stdarg.h:/* Define va_list, if desired, from __gnuc_va_list. */ stdarg.h: but must not use that name. It should use the name __gnuc_va_list, stdarg.h:typedef __gnuc_va_list va_list; stdarg.h:typedef __gnuc_va_list va_list; gcc knows how to do this, splint needs -Iusr/lib/gcc-lib/i386-redhat-linux/3.3.2/include somewhere like .splintrc or on splint CLI invocation.