Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!shlump.nac.dec.com!tkou02.enet.dec.com!diamond From: diamond@tkou02.enet.dec.com (diamond@tkovoa) Newsgroups: comp.std.c Subject: Re: warning: '/*' within comment Message-ID: <1774@tkou02.enet.dec.com> Date: 7 Jun 90 01:05:13 GMT References: <1990Jun1.200433.6919@druid.uucp> <16786@haddock.ima.isc.com> <371@necssd.NEC.COM> Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 34 In article <371@necssd.NEC.COM> harrison@necssd.NEC.COM (Mark Harrison) writes: >In article <16786@haddock.ima.isc.com>, karl@haddock.ima.isc.com (Karl Heuer) writes: >>More generally, `#if 0...#endif' should not be considered a `comment', except >>in the sense of `commenting out code'. The contents are still lexed into C Should be: The contents MIGHT still be lexed into PREPROCESSOR >>tokens, which is why it's also illegal to say >> #if 0 >> The compiler won't like this Should be: SOME perfectly valid compilers won't like this >> #endif >Are you sure about this? I tried your example, and it both compiled and >linted. Your compiler is lazy, legally (i.e. just being efficient, unless you asked for extra checking). Your lint is broken. Get a refund for your lint. >If this is true, then the following should also not work: >#if MICROSOFT >extern far char * x; /* however it's done */ >#endif No, because "far" is a valid preprocessor token. The compiler can't know if you also if'ed out something legal like "#define far unsigned". >#if VMS >extern char * x$something; /* however it's done */ >#endif Yes, compilers can legally complain about this. -- Norman Diamond, Nihon DEC diamond@tkou02.enet.dec.com Proposed group comp.networks.load-reduction: send your "yes" vote to /dev/null.