NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/38977: gcc variadic macro comma-deletion extension in sys/dev/ieee1394/if_fwip.c



>Number:         38977
>Category:       kern
>Synopsis:       gcc variadic macro comma-deletion extension in 
>sys/dev/ieee1394/if_fwip.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 18 04:10:00 +0000 2008
>Originator:     Gregory McGarry
>Release:        -current
>Organization:
>Environment:
>Description:
According to http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html, it is a 
GCC extension to use ## inside variadic macros to permit variadic arguments 
from being omitted (comma-deletion)

#define eprintf(format, ...) fprintf (stderr, format, ## __VA_ARGS__)

and call it like this:

eprintf("only one argument");


>How-To-Repeat:
Compile with c99 compiler.


>Fix:
Revert to using the standard FWIPDEBUG((...)) syntax that almost every other 
source file uses.  Or just use the FreeBSD defintition of FWIPDEBUG.





Home | Main Index | Thread Index | Old Index