🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2255

Re: comment style

#2255
From: Norman Diamond
Date: Tue, 08 Jan 1991 01:32
35 lines
2149 bytes
In article <1050:Jan701:40:4791@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:

>4. It is always obvious, to both human eye and mechanical parser, where
>a // comment ends (viz., the end of the line). It is not so trivial to
>locate the next */.

If it's so obvious, then why was there so much confusion for a while, over
in the C++ newsgroups?  It seems to have been resolved, that if a comment
constains a backslash followed by a newline, the backslash and newline get
eaten early the way ANSI C says, and extend the comment.  But for a while,
they didn't find it so obvious.

In article <1991Jan05.194321.12428@kithrup.COM> sef@kithrup.COM (Sean Eric Fagan) writes:

>Is the if statement part of the comment, or not?  In C comments, no
>characters are special.

Well, after the trigraphs have been kluged, backslash-newlines eaten, and
terminating asterisk-slashes honored, there are no special characters
remaining in the comments.

>/lib/cpp says that
>	/*
>	This is a comment?
>	/\
>	*
>results in an unterminated comment, while msc and gcc both accept it.

I'd agree that
  /* This is a comment? /*
results in an unterminated comment.  What does /lib/cpp say when you
terminate the comment?  How old a /lib/cpp are you using?
--
Norman Diamond       diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Technical Details
Message-ID: <1991Jan8.013213.25299@jituha.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!snorkelwacker.mit.edu!bloom-beacon!deccrl!news.crl.dec.com!pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jituha!jit345!diamond
References: <1991Jan04.164355.15674@sco.COM> <613@caslon.cs.arizona.edu> <1050:Jan701:40:4791@kramden.acf.nyu.edu> <1991Jan05.194321.12428@kithrup.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!snorkelwacker.mit.edu!bloom-beacon!deccrl!news.crl.dec.com!pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jituha!jit345!diamond
From: diamond@jit345.swstokyo.dec.com (Norman Diamond)
Newsgroups: comp.std.c
Subject: Re: comment style
Message-ID: <1991Jan8.013213.25299@jituha.enet.dec.com>
Date: 8 Jan 91 01:32:13 GMT
References: <1991Jan04.164355.15674@sco.COM> <613@caslon.cs.arizona.edu> <1050:Jan701:40:4791@kramden.acf.nyu.edu> <1991Jan05.194321.12428@kithrup.COM>
Sender: news@jituha.enet.dec.com (USENET News System)
Reply-To: diamond@jit345.enet.dec.com (Norman Diamond)
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 35