Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: #ifdef without identifier Message-ID: <541@taumet.com> Date: 15 Dec 90 20:18:02 GMT References: <549@ssp9.idca.tds.philips.nl> Organization: Taumetric Corporation, San Diego Lines: 21 dolf@idca.tds.PHILIPS.nl (Dolf Grunbauer) writes: |We just traced a wierd bug. After some debugging it turned out that parts |of the code was not compiled. The code was something like: |#ifdef /* FLAG */ | do_something(); |#endif |Obviously the source was compiled with -DFLAG. The code between the #ifdef |and #endif was not included in the compilation and everyone looked over this |error (?). The compiler gave no warnings or errors, but I think it should do |so in this case as an 'ifdef' always requires an identifier... According to the ANSI standard, #ifdef must be followed by an identifier, and the compiler must reject as an error the code as given. If your compiler is intended to be ANSI-compliant, you have a legitimate cause for complaint to the vendor. -- Steve Clamage, TauMetric Corp, steve@taumet.com