Serious error-causing change in new CPP's -traditional behavior
Richard Earnshaw
rearnsha@arm.com
Fri May 12 10:19:00 GMT 2000
> Zack Weinberg wrote:
>
> > On Thu, May 11, 2000 at 05:03:46PM +0100, Richard Earnshaw wrote:
> > > What I would like to have is
> > >
> > > #define wibble(foo) mov r0, # foo
> > > .text
> > > a:
> > > wibble(4)
> > >
> > > and get the output
> > >
> > > .text
> > > a:
> > > mov r0, #4
> > >
> > > Unfortunately we get
> > >
> > > mov r0, "4"
> >
> > Alas, this may not have been what you intended, but it is the behavior
> > mandated by the standard for that #define. Whitespace between the
> > stringize operator and its argument (macro name) is not significant.
> > I don't plan to change this in assembly language mode.
>
> This should be made to work as Richard expects for -traditional
>
> Dave
>
True, but in this context we were talking about what would happen if we
stopped using -traditional for assembly.
FWIW, I don't disagree with Zack here; this is just a gotcha that must be
watched for; with the recent patches applied, there are now several viable
alternatives for getting the desired output.
R.
More information about the Gcc-bugs
mailing list