public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/41748]  New: Continued lines are not merged into one long line
@ 2009-10-19  7:08 d dot g dot gorbachev at gmail dot com
  2009-10-19  8:13 ` [Bug preprocessor/41748] " jakub at gcc dot gnu dot org
  2009-10-19 13:18 ` [Bug preprocessor/41748] Adjust documentation to reflect new (afrer rev. 152599) cpp behavior d dot g dot gorbachev at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: d dot g dot gorbachev at gmail dot com @ 2009-10-19  7:08 UTC (permalink / raw)
  To: gcc-bugs

This is a testcase (a space before a backslash or after a newline, and two
pairs of quotes (or no quotes at all), are important):

"hello," \
"world"

In GCC 4.5.0 20091015, preprocessor produces this:

# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
"hello,"
 "world"

whereas older GCC versions give this:

# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
"hello," "world"

Such a new behavior seems to be in contradiction with what the documentation
says: "the backslash is removed and the following line is joined with the
current one."


-- 
           Summary: Continued lines are not merged into one long line
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: d dot g dot gorbachev at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41748


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug preprocessor/41748] Continued lines are not merged into one long line
  2009-10-19  7:08 [Bug preprocessor/41748] New: Continued lines are not merged into one long line d dot g dot gorbachev at gmail dot com
@ 2009-10-19  8:13 ` jakub at gcc dot gnu dot org
  2009-10-19 13:18 ` [Bug preprocessor/41748] Adjust documentation to reflect new (afrer rev. 152599) cpp behavior d dot g dot gorbachev at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-10-19  8:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2009-10-19 08:13 -------
The lines are joined into a logical line, that's what the C standard requires. 
But where do you see requirement that everything on one logical line has to
appear on the line in preprocessed output?  The reason it is emitted on the
next line is to give the second string literal token proper location.  The
tokens are separate and a compiler compiles both "foo" "bar" and
"foo"
"bar"
the same (as it doesn't record the line numbers for the string literals at
all).
See PR41445 for why this change has been made.

If you care about this because you use the preprocessed output for something
else, consider using -P option.  That says you don't care about token
locations.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41748


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug preprocessor/41748] Adjust documentation to reflect new (afrer rev. 152599) cpp behavior
  2009-10-19  7:08 [Bug preprocessor/41748] New: Continued lines are not merged into one long line d dot g dot gorbachev at gmail dot com
  2009-10-19  8:13 ` [Bug preprocessor/41748] " jakub at gcc dot gnu dot org
@ 2009-10-19 13:18 ` d dot g dot gorbachev at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: d dot g dot gorbachev at gmail dot com @ 2009-10-19 13:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from d dot g dot gorbachev at gmail dot com  2009-10-19 13:17 -------
Ok, thanks for the clarification.

I believe this should be documented.


-- 

d dot g dot gorbachev at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Continued lines are not     |Adjust documentation to
                   |merged into one long line   |reflect new (afrer rev.
                   |                            |152599) cpp behavior


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41748


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-19 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-19  7:08 [Bug preprocessor/41748] New: Continued lines are not merged into one long line d dot g dot gorbachev at gmail dot com
2009-10-19  8:13 ` [Bug preprocessor/41748] " jakub at gcc dot gnu dot org
2009-10-19 13:18 ` [Bug preprocessor/41748] Adjust documentation to reflect new (afrer rev. 152599) cpp behavior d dot g dot gorbachev at gmail dot com

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).