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: cpp and compliance to C99


Neil Booth wrote:-

> No, because here each '(' is coming from previous expansions, and
> hence your example is unambiguously nested.  In the examples I posted,
> at some stage a '(' is coming from the remaining source file.

Having said that, I just noticed the "a" and "b" gets the '(' from
existing expansions.  This seems inconsistent; I guess the way old
GCCs behave is to stop being nested as soon as anything is pulled in
from the external file (which makes sense - their tests for
redefinition were based on a macro buffer stack, disabling as you push
buffers and re-enabling as you pop them, and when pulling in new text
the stack would be exhausted).

This is much stronger than and moving away from the appendix J
criterion, and makes me definititely prefer to avoid ambiguity and
consider everything nested (i.e. break away from the behaviour of
previous GCCs).  Any objections?

It would be nice to provide an ambiguity warning for these cases.
Unfortunately, I don't think it's easy, and would require a
performance hit.

Neil.

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