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: backslash-newline, trigraphs, and the C standard


> 
> 
> Joern Rennecke wrote:
> > 
> > > With trigraphs on, this is
> > >
> > >       /* some comment \*/
> > >
> > > so the comment is not ended.  Can anyone come up with any other cases?
> > 
> > But it is ended! \* is just like *.
> > 
> Nope....except for line continuation, backslash is only an escape
> character inside string literals and char literals.
> 
> Dave

So we have two points of view

1) \*/ == */ and the comment ends
2) \*/ is two tokens ('\' and '*/'), so the comment ends.  (If \ is not an 
escape character at this point, it must be a character in its own right.)

Either way, the comment ends.

Richard.


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