Nested Comments in C -- A recent experience

Henry Spencer henry at utzoo.uucp
Tue Mar 13 02:40:51 AEST 1990


In article <133 at caslon.cs.arizona.edu> dave at cs.arizona.edu (David P. Schaumann) writes:
>... I think adding nested comments is the wrong
>solution.  Rather, the compiler should always flag the occurance of /*
>within a comment unless explicitly told to shut up about it.  Does anyone know
>what ANSI says about this?

ANSI C (draft of Oct 88) says -- as all C definitions have always said --
that comments do not nest.  Detection of /* within a comment is mentioned
as a "common warning", which is about the strongest thing the standard
can say about it since the standard does not address what diagnostics a
compiler produces.
-- 
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