preprocessor/1011: __VA_ARGS__ warning in #if-ed out code

harinath@cs.umn.edu harinath@cs.umn.edu
Thu Dec 7 11:16:00 GMT 2000


>Number:         1011
>Category:       preprocessor
>Synopsis:       __VA_ARGS__ warning in #if-ed out code
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 07 11:16:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     harinath@cs.umn.edu
>Release:        unknown-1.0
>Organization:
>Environment:
i686-pc-linux-gnu
gcc version 2.97 20001205 (experimental)
>Description:
GCC complains about __VA_ARGS__ in #if-ed out code,
even in C99 mode.

In C89 mode:

han ~/z/z > gcc -c -std=c89 test.c
test.c:2:20: warning: __VA_ARGS__ can only appear in the expansion of a C99 variable-argument macro
test.c:6:20: warning: __VA_ARGS__ can only appear in the expansion of a C99 variable-argument macro

and in C99 mode:

han ~/z/z > gcc -c -std=c99 test.c
test.c:2:20: warning: __VA_ARGS__ can only appear in the expansion of a C99 variable-argument macro

Line 2 is enclosed in a  #if 0...#endif, and Line 6 is
enclosed in

  #if defined __STDC_VERSION__ && __STDC__VERSION >= 199901L
  ...
  #endif
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.c"

I2lmIDAKI2RlZmluZSBkdW1teSguLi4pIF9fVkFfQVJHU19fCiNlbmRpZgoKI2lmIGRlZmluZWQg
X19TVERDX1ZFUlNJT05fXyAmJiBfX1NURENfVkVSU0lPTl9fID49IDE5OTkwMUwKI2RlZmluZSBk
dW1teSguLi4pIF9fVkFfQVJHU19fCiNlbmRpZgoK


More information about the Gcc-bugs mailing list