Comment removal

Blair P. Houghton bph at buengc.BU.EDU
Thu Feb 9 07:38:21 AEST 1989


In article <3466 at sdsu.UUCP> middleto at sdsu.UCSD.EDU (Tom Middleton) writes:
>In article <> scm at datlog.co.uk ( Steve Mawer ) writes:
>
>i=1/* this is a comment */1 ;
>j=1/* this is
>a comment */1 ;
>
>I tried the above on our SUN, our ELXSI and our CELERITY.  The results
>were the same for all three.  The second line resulted in an error which
>would indicate the comment was replaced by white space of some sort.
>However, the first line worked just fine and the value of i when printed
>was 11.[...]

Bad compiler.  K&Red1 states (word-of-god-time, here... :-) on pg. 8,
"Any characters between /* and */ are ignored by the compiler;
they may be used freely [here's the emphasized part -ed.]
	ANYWHERE A BLANK OR NEWLINE CAN."

I.e., any compiler that thinks a comment is zero-length whitespace
is (umbrellas up, let's hear it, girls!) broke-broke-broke.

Okay, I'll get a grip.
The C Reference Manual appendix to K 'n' R pere only says that "comments
do not nest."
It's entirely likely that the guys with "Standard Conforming" tattooed
on a banner under a arrow-pierced heart on their ctrl-C'ing arm have
a much different idea of what sort of whitespace a comment should be
allowed to be.

>Don't know if this is significant at all and I don't recommend comments
>inside of constants but thought it was interesting enough to mention.

Mention it to the company that wrote the compiler.

Considering that there were _three_ compilers that busted, either someone
isn't paying attention or I'm using superseded info.  My obvious conceit
precludes my choosing the latter.

> G O    P A D R E S !

No comment.  ;->

				--Blair
				  "Except for all this Boggs bull,
				   I'm a Sox fan."



More information about the Comp.lang.c mailing list