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: Zack Weinberg <zack at wolery dot cumb dot org>
- Subject: Re: Serious error-causing change in new CPP's -traditional behavior
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 11 May 2000 16:44:33 +0100
- Cc: Neil Booth <NeilB at earthling dot net>, thorpej at zembu dot com, gcc-bugs at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
> 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.