Nested Comments (long summary)

Henry Spencer henry at utzoo.uucp
Sun Feb 25 15:08:49 AEST 1990


In article <90136 at elsie.UUCP> ado at elsie.UUCP (Arthur David Olson) writes:
>> > To draw the bottom line I would propose: A compiler may well warn
>> > about the sequence slash-asterix *within* a comment...
>> 
>> The Holy Scriptures (Oct 88 draft) in fact mention this as a common warning.
>
>The mention occurs in the Apocrypha. . .er, in an Appendix.  The Standard
>itself says "The contents of a comment are examined *only* to identify
>multibyte characters and to find the characters */ that terminate it"
>(emphasis added).  Since Standard-conforming compilers can only look for
>the terminating */, they cannot hunt for /*'s, at least by my reading.

By this reasoning, compilers would be forbidden to (e.g.) produce source
listings.

The issue comes under the "as if" rule:  so long as the compiler handles
multibyte characters and */ properly, and does not reject the program
or generate different code because of something in a comment, it can do 
anything it wants with comment text.  Warning messages, listings, etc.
are entirely outside the Standard's jurisdiction.
-- 
"The N in NFS stands for Not, |     Henry Spencer at U of Toronto Zoology
or Need, or perhaps Nightmare"| uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list