Unterminated comments

phil at RICE.ARPA phil at RICE.ARPA
Mon Oct 22 18:23:50 AEST 1984


From:  William LeFebvre <phil at RICE.ARPA>

Okay.  I may have misinterpreted the message.  Doug, if I jumped on you
without cause then I apologize.

But please tell me exactly what you meant.  I am interested.  You said:

--------------------
	(1)  Nested comments /* ... A ... /* ... B ... */ ... A ... */
	(2)  Comment-to-end-of-line // ...
(1) would also give an "unterminated comment starting on line nnn" error
if a close-comment */ were omitted, thereby addressing in a different
way the issue this note is a response to...
--------------------

I took the phrase "if a close-comment */ were omitted" to mean a close
comment for any open comment.  Looking at it again I see that it could
have implied "a close-comment" in the context of "/* ... /* ... */ ... */".
So do you mean that the warning message would be given only if the
comment nesting level was greater than one at some point on the line?

Along the same lines, what about comments like:

	/* if input is "/*" then start throwing away characters */

Or worse yet (a sloppy style):

	/* if input is /* then start throwing away characters */

My main objection is that the only characters that have ever had meaning
inside a comment were the comment end characters "*/".  Now you want to
add another sequence.  I am afraid that there are some programs that
were quite legal before that would produce warning (or error) messages
with this change in syntax.  Is that worth worrying about or is it just
picking bones?

                                William LeFebvre
				Department of Computer Science
				Rice University
                                <phil at Rice.arpa>



More information about the Comp.lang.c mailing list