ANSI C and comment preprocessing
Donald Maffly
donald at cae780.csi.com
Tue Jan 8 11:17:23 AEST 1991
In pre-ANSI C compilers, I noticed that it was possible
to place a comment within an idenitfier without
splitting the identifier in two.
The following code segment illustrates this, and
compiles "sans erreur" on all of our C compilers
(which claim to support ANSI C):
main()
{
int my/* comment */var;
myvar = 1;
}
This example may seem pretty obscure to some of you,
but there do exist people who know this
to be a trusted and accepted feature in older C compilers, so
it can't be too obscure.
Well, in "The C Programming Language" (2nd Edition), which
purports to laying down ANSI C Standards, reads in section
"A12. Preprocessing", item #5:
"[...] comments are replaced by a single space;"
Now, if this were true, then the code segment above
wouldn't compile.
Can anyone help me answer this koan????
Donald Maffly
More information about the Comp.lang.c
mailing list