Newsgroups: comp.std.c
Path: 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

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
