Serious error-causing change in new CPP's -traditional behavior
Zack Weinberg
zack@wolery.cumb.org
Fri May 12 11:33:00 GMT 2000
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
More information about the Gcc-bugs
mailing list