This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: preprocessor/2900
- To: nobody at gcc dot gnu dot org
- Subject: Re: preprocessor/2900
- From: neil at gcc dot gnu dot org
- Date: 22 May 2001 18:46:00 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: neil at gcc dot gnu dot org
The following reply was made to PR preprocessor/2900; it has been noted by GNATS.
From: neil@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org, sean@mcneil.com
Cc:
Subject: Re: preprocessor/2900
Date: 22 May 2001 18:38:46 -0000
Synopsis: Does not handle concatenation of macros properly
State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Tue May 22 11:38:46 2001
State-Changed-Why:
This is not a bug - your code is not conforming ISO C.
GCC 3.0 is more strict than earlier versions of GCC.
By invoking
#define RECURSE(han, label, count, saves, cleanup) \
{ void **new = mc_stack_ptr + count + 1; \
PUSH_VALUES ## count ## saves; \
}
with
RECURSE(cb, "label", 2, (void *, h, int, parentMark), cb);
CPP pastes PUSH_VALUES and 2 to get PUSH_VALUES2. It then tries to paste
PUSH_VALUES2 and '(', the first token of "saves", which is an invalid
operation.
The fix in this case is to redefine RECURSE as
#define RECURSE(han, label, count, saves, cleanup) \
{ void **new = mc_stack_ptr + count + 1; \
PUSH_VALUES ## count saves; \
}
Whether that does what you want in general is a different
question.
Neil.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2900&database=gcc