This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: preprocessor/9764: Varargs macro extension incorrectly expands if the varargs argument is the macro itself
- From: neil at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, rpm31 at student dot canterbury dot ac dot nz
- Date: 19 Feb 2003 23:48:50 -0000
- Subject: Re: preprocessor/9764: Varargs macro extension incorrectly expands if the varargs argument is the macro itself
- Reply-to: neil at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, rpm31 at student dot canterbury dot ac dot nz, gcc-gnats at gcc dot gnu dot org
Synopsis: Varargs macro extension incorrectly expands if the varargs argument is the macro itself
State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Wed Feb 19 23:48:50 2003
State-Changed-Why:
3.1 and later give the following, which is correct. I've not checked 3.0, but I expect it's similar.
$ cat /tmp/bar.c
#define func(a, varargs...) _func(a, ##b)
func(a, func(a, b));
$ gcc -E /tmp/bar.c
# 1 "/tmp/bar.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "/tmp/bar.c"
/tmp/bar.c:3:19: pasting "," and "b" does not give a valid preprocessing token
_func(a,b);
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9764