cpplib: backslash-newline

Dave Brolley brolley@redhat.com
Mon Aug 28 12:56:00 GMT 2000


Zack Weinberg wrote:

> On Sun, Aug 27, 2000 at 02:34:29PM +0100, Neil Booth wrote:
> > It has been requested by Zack and Per that a backslash and newline
> > separated by whitespace still be treated as a backslash-newline.
> This
> > does that, and keeps the warning.  At the moment, a comment falls
> into
> > the definition of "whitespace" here, but let's leave it be for the
> > moment.  That'll be simpler to fix with the lexer rewrite I hope to
> > start soon.
>
> While this does hit all of the important situations that users
> complain about, you haven't handled backslash space newline inside
> comments or strings.  This makes the behavior inconsistent.  I don't
> think we want that.
>
> Also it should be turned off by -ansi; I'm not 100% persuaded this is
> standards-conforming behavior.
>
I believe that it is conforming. Wherever the standard refers to
'newline', they are referring to an 'end-of-line indicator' (see phase 1
of the phases of translation) which can defined as anything that's
reasonable. Certainly ignoring extraneous whitespaces at the end of a
line is resonable, since it is more likely to be a bug than anything
intentional.

Dave



More information about the Gcc-patches mailing list