public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* preprocessor/3786: cpp ignores space after backslash
@ 2001-07-24 2:26 loewis
0 siblings, 0 replies; 3+ messages in thread
From: loewis @ 2001-07-24 2:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 3786
>Category: preprocessor
>Synopsis: cpp ignores space after backslash
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Tue Jul 24 02:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: loewis@informatik.hu-berlin.de
>Release: 3.0
>Organization:
>Environment:
System: SunOS pandora 5.8 Generic_108528-06 sun4u sparc SUNW,Ultra-Enterprise
Architecture: sun4
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../configure --enable-shared --enable-threads --with-cpu=v8 --with-gnu-ld --with-gnu-as --enable-version-specific-runtime-libs
>Description:
The preprocessor will ignore spaces between a backslash and a newline
for continuation lines. This is in violation of C99, 5.1.1.2,
# Each instance of a backslash character (\) immediately followed
# by a new-line character is deleted
As a result, a // comment ending in a backslash eats the next line.
>How-To-Repeat:
/* Compile the following program with g++ -E. Notice the space after
the backslash. */
// This is a single-line comment \
int i;
>Fix:
In cpplex.c:skip_escaped_newlines, rewrite the escape logic to not
accept spaces immediately after the backslash, atleast not if in
some strict mode.
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: preprocessor/3786: cpp ignores space after backslash
@ 2001-07-29 5:19 neil
0 siblings, 0 replies; 3+ messages in thread
From: neil @ 2001-07-29 5:19 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, loewis, nobody, rittau
Synopsis: cpp ignores space after backslash
State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Sun Jul 29 05:19:53 2001
State-Changed-Why:
Not a bug - this is documented behaviour in the manual.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3786&database=gcc
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: preprocessor/3786: cpp ignores space after backslash
@ 2001-07-24 2:36 Joseph S. Myers
0 siblings, 0 replies; 3+ messages in thread
From: Joseph S. Myers @ 2001-07-24 2:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR preprocessor/3786; it has been noted by GNATS.
From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: <loewis@informatik.hu-berlin.de>
Cc: <gcc-gnats@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>
Subject: Re: preprocessor/3786: cpp ignores space after backslash
Date: Tue, 24 Jul 2001 10:33:55 +0100 (BST)
On Tue, 24 Jul 2001 loewis@informatik.hu-berlin.de wrote:
> The preprocessor will ignore spaces between a backslash and a newline
> for continuation lines. This is in violation of C99, 5.1.1.2,
> # Each instance of a backslash character (\) immediately followed
> # by a new-line character is deleted
> As a result, a // comment ending in a backslash eats the next line.
This is part of the implementation-defined translation phase 1 mapping:
invisible white space at the end of lines is ignored. There *is* a bug -
that this feature ought to be mentioned under "Implementation-defined
behavior" in the manual.
--
Joseph S. Myers
jsm28@cam.ac.uk
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-07-29 5:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-24 2:26 preprocessor/3786: cpp ignores space after backslash loewis
2001-07-24 2:36 Joseph S. Myers
2001-07-29 5:19 neil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).