Nested Comments in C -- A recent experience

Henry Spencer henry at utzoo.uucp
Mon Mar 12 08:27:04 AEST 1990


In article <1990Mar11.065712.9798 at usenet.ins.cwru.edu> crds at pyrite.som.cwru.edu (Glenn A. Emelko) writes:
>... 3 hours looking for a "bug" which turned out not to be a "bug" at all;
>rather it went undetected as a programming error BECAUSE our C compiler doesn't
>handle nested comments (like most C compilers don't)...

You mean "because our C compiler doesn't issue a warning when it sees /*
inside a comment".  C COMMENTS DO NOT NEST.  THEY NEVER HAVE.  ANY COMPILER
WHICH "HANDLES" NESTED COMMENTS IS NOT A C COMPILER.  It is legitimate to
complain about a compiler which doesn't flag /* in a comment as a possible
error, but claiming that a C compiler should "handle nested comments" is
just silly; no C compiler can do that.
-- 
MSDOS, abbrev:  Maybe SomeDay |     Henry Spencer at U of Toronto Zoology
an Operating System.          | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list