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: A##B a preprocessing token?


Carlo Wood wrote:
> 
> On Tue, Nov 06, 2001 at 04:26:07PM +0100, Jiri Kolafa wrote:
> > I have used for years a construct that translates
> >   loop (i,from,to)
> > into
> >   for (i=from; i<to; i++)
> > and at the same time
> >   loop (i,from,=to)
> > into
> >   for (i=from; i<=to; i++)
> 
> This doesn't seem a good reason to remove the warning:
> It is an ugly way of programming and deserves a
> warning imho (disclaimer: I am not a gcc developer).

I don't think it's up to the compiler to judge the aesthetics of
code ;-) I believe what Jiri is looking for is a more technical
justification for the warning which might be 6.8.3.3 of C89 and
6.10.3.3, p3 of C99:

    ...If the result is not a valid preprocessing token, the
    behavior is undefined...

Regards
Martin


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