warning: '/*' within comment
Lars Henrik Mathiesen
thorinn at skinfaxe.diku.dk
Sat Jun 9 08:48:27 AEST 1990
karl at 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
<tokens ...
diamond at tkou02.enet.dec.com (diamond at tkovoa) writes:
<Should be: The contents MIGHT still be lexed into PREPROCESSOR tokens
<> #if 0
<> The compiler won't like this
<Should be: SOME perfectly valid compilers won't like this
<> #endif
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:
----------- cut -----------
#include <stdio.h>
#if 0
C's weird\
#if 1 /* isn't it */
#else
int main(int c, char *v[]) { printf("Hello, world!\n"); return 0; }
#endif
----------- cut -----------
--
Lars Mathiesen, DIKU, U of Copenhagen, Denmark [uunet!]mcsun!diku!thorinn
Institute of Datalogy -- we're scientists, not engineers. thorinn at diku.dk
More information about the Comp.std.c
mailing list