#ifdef

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Dec 7 02:55:13 AEST 1989


In article <9326 at microsoft.UUCP> azeemk at microsoft.UUCP (Azeem Kahn) writes:
-#else
-/*
-#endif
-*/
-#endif
-VAR is defined and hence the #else is the inactive segment. Now
-should the preprocessor match the #else with the first or the
-second #endif? In other words, does the preprocessor have to look
-at the lines in the inactive segment for comments, unclosed qoutes
-etc. OR should it disregard everything in the inactive segment and
-just keep looking for a matching #endif to satisfy the nesting.

This is answered in section 2.1.1.2, "Translation phases".
Comments are replaced by spaces before preprocessing directives
are executed.
Thus there is no "first #endif"; it is commented-out.



More information about the Comp.std.c mailing list