public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/45696] New: Continuation character gets lost or not taken into account
@ 2010-09-16 23:52 John dot Tytgat at aaug dot net
2010-09-16 23:56 ` [Bug preprocessor/45696] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: John dot Tytgat at aaug dot net @ 2010-09-16 23:52 UTC (permalink / raw)
To: gcc-bugs
Using gcc 4.6.0 20100915 trunk revision 164317
Using the preprocessor on following piece:
--8<--
error_identifiers: \
kErr_AlreadyWaitingForGDB("Already waiting for a GDB to connect")
--8<--
gcc -E gives me:
--8<--
# 1 "test-preprocess.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test-preprocess.c"
error-identifiers:
kErr_AlreadyWaitingForGDB("Already waiting for a GDB to connect")
--8<--
I.e. the continuation character got lost or was not taken into account. Either
I expect it to survive the preprocessing, either it should have been taken into
account like e.g. with gcc 4.1.2:
--8<--
# 1 "test-preprocess.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "test-preprocess.c"
error-identifiers: kErr_AlreadyWaitingForGDB("Already waiting for a GDB to
connect")
--8<--
--
Summary: Continuation character gets lost or not taken into
account
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: John dot Tytgat at aaug dot net
GCC build triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45696
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug preprocessor/45696] Continuation character gets lost or not taken into account
2010-09-16 23:52 [Bug preprocessor/45696] New: Continuation character gets lost or not taken into account John dot Tytgat at aaug dot net
@ 2010-09-16 23:56 ` pinskia at gcc dot gnu dot org
2010-09-17 0:05 ` John dot Tytgat at aaug dot net
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-09-16 23:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2010-09-16 23:55 -------
C preprocessor is not a generic preprocessor. The continuation character is
removed so the correct line number is used.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45696
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug preprocessor/45696] Continuation character gets lost or not taken into account
2010-09-16 23:52 [Bug preprocessor/45696] New: Continuation character gets lost or not taken into account John dot Tytgat at aaug dot net
2010-09-16 23:56 ` [Bug preprocessor/45696] " pinskia at gcc dot gnu dot org
@ 2010-09-17 0:05 ` John dot Tytgat at aaug dot net
2010-09-17 0:07 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: John dot Tytgat at aaug dot net @ 2010-09-17 0:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from John dot Tytgat at aaug dot net 2010-09-17 00:04 -------
I don't understand why the continuation character should be removed. For the C
parser that character is not special (only for the C preprocessor it is), nor
it confuses its line number accountancy. Or am I mistaken ?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45696
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug preprocessor/45696] Continuation character gets lost or not taken into account
2010-09-16 23:52 [Bug preprocessor/45696] New: Continuation character gets lost or not taken into account John dot Tytgat at aaug dot net
2010-09-16 23:56 ` [Bug preprocessor/45696] " pinskia at gcc dot gnu dot org
2010-09-17 0:05 ` John dot Tytgat at aaug dot net
@ 2010-09-17 0:07 ` pinskia at gcc dot gnu dot org
2010-09-17 7:09 ` jakub at gcc dot gnu dot org
2010-09-17 8:54 ` manu at gcc dot gnu dot org
4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-09-17 0:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2010-09-17 00:06 -------
(In reply to comment #2)
> I don't understand why the continuation character should be removed. For the C
> parser that character is not special (only for the C preprocessor it is), nor
> it confuses its line number accountancy. Or am I mistaken ?
You are confused. It is removed so that the column information for the call to
AlreadyWaitingForGDB is on the correct line.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45696
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug preprocessor/45696] Continuation character gets lost or not taken into account
2010-09-16 23:52 [Bug preprocessor/45696] New: Continuation character gets lost or not taken into account John dot Tytgat at aaug dot net
` (2 preceding siblings ...)
2010-09-17 0:07 ` pinskia at gcc dot gnu dot org
@ 2010-09-17 7:09 ` jakub at gcc dot gnu dot org
2010-09-17 8:54 ` manu at gcc dot gnu dot org
4 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-09-17 7:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2010-09-17 07:09 -------
You can use gcc -E -P, then it doesn't print # <lineno> <file>
lines and puts the label and fn on the same line (as, without the line notes
locations aren't preserved anyway).
As Andrew wrote, gcc -E is a C/C++ preprocessor, and the semantics of
label:
fn (args)
is the same as
label: fn (args)
and the former maintains better the location info.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45696
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug preprocessor/45696] Continuation character gets lost or not taken into account
2010-09-16 23:52 [Bug preprocessor/45696] New: Continuation character gets lost or not taken into account John dot Tytgat at aaug dot net
` (3 preceding siblings ...)
2010-09-17 7:09 ` jakub at gcc dot gnu dot org
@ 2010-09-17 8:54 ` manu at gcc dot gnu dot org
4 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-09-17 8:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from manu at gcc dot gnu dot org 2010-09-17 08:54 -------
I have seen this question/bug reported a couple of times in bugzilla and a few
more in gcc-help, so I added a FAQ:
http://gcc.gnu.org/wiki/FAQ#cpp_continuation_discarded
I suggest that it is rather more useful to answer such questions in the wiki
and then always provide a link. Moreover, the answers in the wiki tend to be
more satisfactory and clear (if not, they can be gradually improved).
Otherwise, the same questions are answered again and again but the answers tend
to not be uniform in terms of clarity and quality.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45696
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <bug-45696-4@http.gcc.gnu.org/bugzilla/>]
end of thread, other threads:[~2011-01-17 14:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-16 23:52 [Bug preprocessor/45696] New: Continuation character gets lost or not taken into account John dot Tytgat at aaug dot net
2010-09-16 23:56 ` [Bug preprocessor/45696] " pinskia at gcc dot gnu dot org
2010-09-17 0:05 ` John dot Tytgat at aaug dot net
2010-09-17 0:07 ` pinskia at gcc dot gnu dot org
2010-09-17 7:09 ` jakub at gcc dot gnu dot org
2010-09-17 8:54 ` manu at gcc dot gnu dot org
[not found] <bug-45696-4@http.gcc.gnu.org/bugzilla/>
2011-01-17 14:49 ` rguenth at gcc dot gnu.org
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).