🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1968

Re: Comment Syntax

#1968
From: Henry Spencer
Date: Tue, 13 Nov 1990 17:53
20 lines
1314 bytes
In article <48.UUL1.3#5077@aussie.COM> rex@aussie.COM (Rex Jaeschke) writes:
>Let me suggest that you CANNOT add // comments to an ANSI C compiler 
>WITHOUT some hacking. Consider the following example:
>
>int i;	// this comment ends in a backslash \
>int j;
> ...
>So, for a future version of ANSI C to adopt //, they would have to 
>either rearrange the phases of translation (unlikely since that would 
>no longer be backwards compatible) or to treat // and /**/ comments 
>differently and add a new phase for //.

Um, why?  In ANSI C, this program fragment is illegal -- a syntax error --
and the standard does not constrain responses to syntax errors.  If //
comments were added, some programs that are now syntactically erroneous
would become legal, but that is true of many types of extension.  I don't
see the problem.
-- 
"I don't *want* to be normal!"         | Henry Spencer at U of Toronto Zoology
"Not to worry."                        |  henry@zoo.toronto.edu   utzoo!henry
Technical Details
Message-ID: <1990Nov13.175313.2521@zoo.toronto.edu>
Path: arc1-ca.pugleaf.net!utzoo!henry
References: <14390@smoke.brl.mil> <48.UUL1.3#5077@aussie.COM>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: Comment Syntax
Message-ID: <1990Nov13.175313.2521@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <14390@smoke.brl.mil> <48.UUL1.3#5077@aussie.COM>
Date: Tue, 13 Nov 90 17:53:13 GMT