Path: utzoo!attcan!uunet!samsung!uakari.primate.wisc.edu!xanth!mcnc!decvax.dec.com!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: <1777@tkou02.enet.dec.com> Date: 11 Jun 90 00:56:41 GMT References: <1990Jun1.200433.6919@druid.uucp> <16786@haddock.ima.isc.com> <371@necssd.NEC.COM> <1774@tkou02.enet.dec.com> <1990Jun8.224827.23783@diku.dk> Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 30 In article <1990Jun8.224827.23783@diku.dk> thorinn@skinfaxe.diku.dk (Lars Henrik Mathiesen) writes: >If you know of an ANSI C compiler (I don't think it's ``perfectly >valid'' otherwise) which does not lex #if'fed-out blocks into >pptokens, please explain how it handles this conformant (I think) >program: >#include >#if 0 >C's weird\ >#if 1 /* isn't it */ >#else >int main(int c, char *v[]) { printf("Hello, world!\n"); return 0; } >#endif What's the problem? #include #if 0 C's weird#if 1 /* isn't it */ #else int main(int c, char *v[]) { printf("Hello, world!\n"); return 0; } #endif preprocesses to [contents of ] int main(int c, char *v[]) { printf("Hello, world!\n"); return 0; } regardless of whether the preprocessor really tokenizes or not the line C's weird#if 1 /* isn't it */ -- Norman Diamond, Nihon DEC diamond@tkou02.enet.dec.com Proposed group comp.networks.load-reduction: send your "yes" vote to /dev/null.