This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib preparation for identifier spelling preservation
On Fri, 22 May 2009, Ian Lance Taylor wrote:
> "Joseph S. Myers" <joseph@codesourcery.com> writes:
>
> > In fact I think
> > the special phase 1 handling of backslash-whitespace-newline is a bad
> > idea (cf. discussions of how this does not allow writing some C++0x
> > raw strings) and we should remove that as well and then close bug 8270
> > as fixed, but that may be more controversial.)
>
> I assume you are talking about the way that gcc ignores whitespace
> between a backslash and a newline. The argument in favor of the current
Yes.
> behaviour is that gcc's behaviour is not affected by something which can
> not be seen. The argument against is that this violates the common
> understanding of the language, although it is technically permitted by
> the standard.
>
> I think the sensible approach is
>
> 1) Treat \\\n as a line continuation (this is obvious).
>
> 2) Treat \\\r\n as a line continuation.
I would group these together as "treat \r, \n and \r\n as newline"
(everywhere, including in raw strings).
--
Joseph S. Myers
joseph@codesourcery.com