This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: preprocessor bug: @ + MACRO does not work in gcc-3.0
On Mon, Mar 05, 2001 at 08:58:33PM +0000, Neil Booth wrote:
> Zack Weinberg wrote:-
>
> > I agree with you that (2) is a bad solution. However, I don't like
> > (1) either. It is a major quiet change to the semantics of Objective
> > C. I have no way of evaluating how widespread this sort of thing is,
> > so I'm going to be really conservative.
> >
> > Also, looking at cpplex.c and c-parse.in, I think going for (3) might
> > actually simplify the code. What do you think of the appended patch?
> > With it, the preprocessor crunches Nicola's test case correctly.
> > However, this only exposes another bug - see separate report.
>
> Two things:
>
> 1) Is it a good idea to introduce yet another token type, when CPP_OTHER
> would do (from what I can see)?
It makes life easier for the front end, which doesn't have access to
the cpp_token at the point we have to detect '@'. And it's
consistent; all other significant punctuators get their own token types.
> 2) Don't you just drop stray @ tokens, in e.g.
>
> int x = y @ + z;
>
> without a diagnostic? (And what about in C?)
Drat. Yes (only in ObjC). I'll have to think about this some more.
zw