Nested Comments in C -- A recent experience

Henry Spencer henry at utzoo.uucp
Sun Mar 18 14:52:38 AEST 1990


In article <9631 at wpi.wpi.edu> msau at wpi.wpi.edu (Matt Saucier) writes:
>To Mr HS.  If you say that C compilers that allow, or can allow, nested
>comments are not C compilers, then you are very nieve...

I guess I'm just old-fashioned:  I feel that to be called a C compiler,
it should compile C.  Every definition of C, from the earliest days,
has been explicit that C comments do not nest.

>... Although I don't use the nested comment
>method (I use #ifdef DEBUG #endif (or whatever)), I know a lot of people who
>do use them....

As has been explained at length, several times, this is a thoroughly bad
idea that programmers eventually learn to avoid.  It simply doesn't work
as well as #ifdef.
-- 
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