This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: backslash-newline, trigraphs, and the C standard
- To: Dave Brolley <brolley at cygnus dot com>
- Subject: Re: backslash-newline, trigraphs, and the C standard
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Fri, 14 Jan 2000 14:20:27 +0000
- Cc: Joern Rennecke <amylaar at cygnus dot co dot uk>, Joe Buck <jbuck at synopsys dot COM>, Geoff Keating <geoffk at cygnus dot com>, Zack Weinberg <zack at wolery dot cumb dot org>, gcc at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
>
>
> 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.