Bug 115634 - split thows up an error in /usr/include/sys/syslog.h line 187 __gnuc_va_list is not defined. Have to include /usr/include/err.h for a def of _gnuc_va_list
split thows up an error in /usr/include/sys/syslog.h line 187 __gnuc_va_list...
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: splint (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-13 19:46 EST by Philip Shearer
Modified: 2007-04-18 13:02 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-02-14 00:33:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Philip Shearer 2004-02-13 19:46:36 EST
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>
Comment 1 Jeff Johnson 2004-02-14 00:33:05 EST
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.



Note You need to log in before you can comment on or make changes to this bug.