Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!mephisto!utkcs2!alphard!battle From: battle@alphard.cs.utk.edu (David Battle) Newsgroups: comp.lang.c Subject: Re: This one bit me today Message-ID: <1501@utkcs2.cs.utk.edu> Date: 14 Dec 89 15:16:23 GMT References: <2739@hub.UUCP> <1989Oct28.005308.11463@virtech.uucp> <1989Nov28.145229.27060@sssab.se> <426@jhereg.Minnetech.MN.ORG> Sender: news@utkcs2.cs.utk.edu Reply-To: battle@alphard.cs.utk.edu (David Battle) Organization: CS Dept -- University of TN, Knoxville Lines: 37 In article <426@jhereg.Minnetech.MN.ORG> Mark H. Colburn writes: >In article <1989Nov28.145229.27060@sssab.se> [...] (Paul Svensson) writes: > >#ifdef notdef > > "!%()[]/*", > >#endif > > > >I know at least one compiler that fail to realize that this does not > >start a comment. > > Get a new compiler. That one is busted... What SHOULD the following program do? Why? #ifdef NOTDEF /* #endif #define COMMENT_NOT_EFFECTIVE 1 #ifdef NOTDEF */ #endif int main(int argc, char **argv) { #ifdef COMMENT_NOT_EFFECTIVE (void) printf("#ifdef takes precidence.\n"); #else (void) printf("/* takes precidence.\n"); #endif return 0; } -David L. Battle battle@battle.esd.ornl.gov battle@utkvx2.BITNET