This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -traditional comment elimination (yuk...)


On Fri, May 12, 2000 at 05:44:35PM +0900, Neil Booth wrote:
> Hi Zack,
> 
> Zack Weinberg wrote:-
> 
> > Having read the entire discussion, I think we're working much too
> > hard.
> 
> Hmm, no, I think you've minunderstood the issue.  See Dave's first
> post about the real effect of comments on K&R compilers.
> 
> > If I understand correctly, the problems only come up when -traditional
> > and -C are used simultaneously.  -traditional by itself shouldn't be a
> > problem, as the comments get no tokens and don't set PREV_WHITESPACE
> > on the next token, so paste happens normally.  Correct?
> 
> The problem is with -traditional period.  As I said in the first mail
> in this thread (when I didn't understand traditional comments fully)
> names and identifiers don't undergo pasting.

Yes, I reread it, and I get it now.  But I don't see how this follows:

> No, the problems will appear on any line, but *only when we combine
> cpplib and the front end*.  We get away with it until then because the
> front end does its own lexing pass.

because, in open text

foo &/**/& bar

should be being pasted into <foo> <&&> <bar> already, in
_cpp_lex_line, simply because a traditional /**/ will vanish utterly.
If we don't do that, that's the problem.

To get the variant effect of comments on directive lines (other than
#define), we could cause comments to be equivalent to whitespace in
directives, even when -traditional (which is what a K+R preprocessor
did).

I wouldn't worry about

//**/* this is a comment */

unless and until someone reports that this breaks real code.

zw

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]