This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Serious error-causing change in new CPP's -traditional behavior


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]