This is the mail archive of the
mailing list for the GCC project.
Re: cpplib preparation for identifier spelling preservation
- From: Ian Lance Taylor <iant at google dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 22 May 2009 17:29:17 -0700
- Subject: Re: cpplib preparation for identifier spelling preservation
- References: <Pine.LNX.email@example.com>
"Joseph S. Myers" <firstname.lastname@example.org> 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
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
I think the sensible approach is
1) Treat \\\n as a line continuation (this is obvious).
2) Treat \\\r\n as a line continuation.
3) Otherwise, do not treat \\.+\n as a line continuation.
4) When not in a /* */ comment, issue a warning about \\[ \t\r\f\v]+\n
when not treating it as a line continuation. The warning should be
on by default, with an option to turn it off. This would be a
recreation of the old -Wwhite-space option.
5) It would be nice if that warning were suppressed in the case of a //
comment ending in a backslash followed by whitespace if the next line
starts with zero or more whitespace characters followed by a //