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 Thu, May 11, 2000 at 07:15:38AM +0900, Neil Booth wrote:
> > Zack Weinberg wrote:-
> > 
> > > A marginally better stupid game:
> > > 
> > > #define IMMED(n) # ##n
> > > #define foo() mov	r0, IMMED(5)
> > 
> > Or I could just get the lexer to drop all CPP_HASH tokens that are not
> > the first token (so we still allow directives) if the assembler option
> > is true?
> 
> No!  That would have the effect of deleting every # from the output,
> which is definitely not what Richard wants.
> 
> What I believe he wants is more along the lines of this patch.
> Richard, care to give it a spin?

Yes, that looks fine.  It even works for

#define foo 3
#define wibble() mov    r0, #foo
.text
a:
        wibble()

Ie, where the 'argument' is a #define substitution.

Thanks,
R.



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