Problems with GCC and/or VAX LINK

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Mar 17 09:25:08 AEST 1989


In article <1732 at levels.sait.edu.au> ccdn at levels.sait.edu.au (DAVID NEWALL) writes:
>Mind you, this is still a problem.  A program section which is
>conditionally  _not_ compiled should be treated like a comment -- it
>shouldn't matter what's inside the #ifdef/#endif.

More precisely, it should be scanned for preprocessor # directives
so it can properly tell where the matching #else or #endif is.
The only other form of syntax checking performed on a skipped group
is the parsing into "preprocessing tokens".  The pANS explicitly
states that an unmatched ' or " produces "undefined behavior", so
GCC is allowed to complain about it (or accept it as just a character).

This tokenizing behavior is considerably more structured than many
existing C preprocessors support (notably the Reiser cpp).  One is
not allowed to have arbitrary garbage #if 0'ed out; it must consist
of a sequence of valid preprocessing tokens.



More information about the Comp.lang.c mailing list