🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1971

Re: Comment Syntax

#1971
From: David Wald
Date: Tue, 13 Nov 1990 18:18
31 lines
1656 bytes
In article <48.UUL1.3#5077@aussie.COM> rex@aussie.COM (Rex Jaeschke) writes:
>> In article <HAGERMAN.90Nov7193212@rx7.ece.cmu.edu> hagerman@ece.cmu.edu (John Hagerman) writes:
>> >Why didn't // ... newline comments make it into ANSI C?
>> 
>
>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;
>
>f()
>{
>	i = j;	/* error: j is not declared */
>} 
>
>ANSI's phases of translation require that backslash/new-lines be 
>processed BEFORE comments. In this case the 2 declaration lines would 
>become:
>
>int i;	// this comment ends in a backslash int j;

How much of a problem would this be?  It would mean that \\\n behaves
the same in comments as outside them, but that is already the case.
What do BCPL or C++ do with a comment like this?

-David
--
============================================================================
David Wald                                           wald@theory.lcs.mit.edu
============================================================================
Technical Details
Message-ID: <1990Nov13.181856.17322@mintaka.lcs.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!mintaka!wald
References: <14390@smoke.brl.mil> <48.UUL1.3#5077@aussie.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!mintaka!wald
From: wald@theory.lcs.mit.edu (David Wald)
Newsgroups: comp.std.c
Subject: Re: Comment Syntax
Message-ID: <1990Nov13.181856.17322@mintaka.lcs.mit.edu>
Date: 13 Nov 90 18:18:56 GMT
References: <14390@smoke.brl.mil> <48.UUL1.3#5077@aussie.COM>
Sender: daemon@mintaka.lcs.mit.edu (Lucifer Maleficius)
Reply-To: wald@theory.lcs.mit.edu (David Wald)
Organization: Laboratory for Computer Science, MIT
Lines: 31