Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: #ifdef Keywords: preprocessor, inactive segments Message-ID: <11753@smoke.BRL.MIL> Date: 6 Dec 89 15:55:13 GMT References: <9326@microsoft.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 17 In article <9326@microsoft.UUCP> azeemk@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.