Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Nested Comments (long summary) Message-ID: <1990Feb25.040849.20701@utzoo.uucp> Organization: U of Toronto Zoology References: <1523@wacsvax.OZ> <13706@cbnewsc.ATT.COM> <4286@jhunix.HCF.JHU.EDU> <1990Feb22.195335.14690@utzoo.uucp> <90136@elsie.UUCP> Date: Sun, 25 Feb 90 04:08:49 GMT In article <90136@elsie.UUCP> ado@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@zoo.toronto.edu