This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Serious error-causing change in new CPP's -traditional behavior
- To: Dave Brolley <brolley at redhat dot com>
- Subject: Re: Serious error-causing change in new CPP's -traditional behavior
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Fri, 12 May 2000 11:33:12 -0700
- Cc: rearnsha at arm dot com, Neil Booth <NeilB at earthling dot net>, thorpej at zembu dot com, gcc-bugs at gcc dot gnu dot org
- References: <200005121744.SAA10400@cam-mail2.cambridge.arm.com> <391C11F1.93F92DD5@redhat.com>
On Fri, May 12, 2000 at 10:15:13AM -0400, Dave Brolley wrote:
> Richard Earnshaw wrote:
>
> > We were trying to avoid that particular contortion, but there are several
> > other reasonable solutions.
> >
> > #define IMMED(x) # ## x
> > #define wibble(foo) mov r0, IMMED(foo)
>
> Not legal -- the token following # must be the name of a macro argument
Actually, this is legal; the ## converts the # into an ordinary
token. It does rely on the unspecified order of evaluation of # and
## operators, but we always do ## first.
That's my reading of 6.10.3 and therefore the way I implemented it.
> > #define wibble(foo) mov r0, #(foo) /* If brackets ok */
This is illegal, but accepted without complaint in an .S file. That
was the original change Richard requested.
> > #define wibble(foo) mov r0, # /**/ foo /* I think... not tested */
>
> Nope -- will still output "4"
Yup.
zw