public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105207] New: C preprocessor: splicing physical source lines to form logical source lines may not work
@ 2022-04-09 21:49 pavel.morozkin at gmail dot com
  2022-04-09 21:58 ` [Bug c/105207] " pavel.morozkin at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pavel.morozkin at gmail dot com @ 2022-04-09 21:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105207

            Bug ID: 105207
           Summary: C preprocessor: splicing physical source lines to form
                    logical source lines may not work
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pavel.morozkin at gmail dot com
  Target Milestone: ---

Sample code:
xxx \
#error

Invocation:
$ gcc t6.c -E

Actual output:
xxx
 #error

Expected output:
xxx #error

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

* [Bug c/105207] C preprocessor: splicing physical source lines to form logical source lines may not work
  2022-04-09 21:49 [Bug c/105207] New: C preprocessor: splicing physical source lines to form logical source lines may not work pavel.morozkin at gmail dot com
@ 2022-04-09 21:58 ` pavel.morozkin at gmail dot com
  2022-04-09 22:22 ` [Bug c/105207] Translation phase 2: " pavel.morozkin at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pavel.morozkin at gmail dot com @ 2022-04-09 21:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105207

--- Comment #1 from Pavel M <pavel.morozkin at gmail dot com> ---
The same behavior with:
xxx \
error

Expected:
xxx error

Actual:
xxx
 error

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

* [Bug c/105207] Translation phase 2: splicing physical source lines to form logical source lines may not work
  2022-04-09 21:49 [Bug c/105207] New: C preprocessor: splicing physical source lines to form logical source lines may not work pavel.morozkin at gmail dot com
  2022-04-09 21:58 ` [Bug c/105207] " pavel.morozkin at gmail dot com
@ 2022-04-09 22:22 ` pavel.morozkin at gmail dot com
  2022-04-10  0:15 ` [Bug preprocessor/105207] " pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pavel.morozkin at gmail dot com @ 2022-04-09 22:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105207

Pavel M <pavel.morozkin at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|C preprocessor: splicing    |Translation phase 2:
                   |physical source lines to    |splicing physical source
                   |form logical source lines   |lines to form logical
                   |may not work                |source lines may not work

--- Comment #2 from Pavel M <pavel.morozkin at gmail dot com> ---
Actually the issue is not related to the preprocessor. It is relayed to the
translation phase 2. Please

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

* [Bug preprocessor/105207] Translation phase 2: splicing physical source lines to form logical source lines may not work
  2022-04-09 21:49 [Bug c/105207] New: C preprocessor: splicing physical source lines to form logical source lines may not work pavel.morozkin at gmail dot com
  2022-04-09 21:58 ` [Bug c/105207] " pavel.morozkin at gmail dot com
  2022-04-09 22:22 ` [Bug c/105207] Translation phase 2: " pavel.morozkin at gmail dot com
@ 2022-04-10  0:15 ` pinskia at gcc dot gnu.org
  2022-04-11 22:16 ` pavel.morozkin at gmail dot com
  2022-12-10  7:18 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-04-10  0:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105207

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note this only matters if you preprocessing the file yourself; that is
-save-temps works correctly and errors out that there is a stray '#' in
program.

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

* [Bug preprocessor/105207] Translation phase 2: splicing physical source lines to form logical source lines may not work
  2022-04-09 21:49 [Bug c/105207] New: C preprocessor: splicing physical source lines to form logical source lines may not work pavel.morozkin at gmail dot com
                   ` (2 preceding siblings ...)
  2022-04-10  0:15 ` [Bug preprocessor/105207] " pinskia at gcc dot gnu.org
@ 2022-04-11 22:16 ` pavel.morozkin at gmail dot com
  2022-12-10  7:18 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pavel.morozkin at gmail dot com @ 2022-04-11 22:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105207

--- Comment #4 from Pavel M <pavel.morozkin at gmail dot com> ---
To: Andrew Pinski

At the 1st glance I expected to see that -E produces the output after splicing
is done (i.e. xxx #error). However, the "preprocessing only" is out of scope of
the C11. As stackoverflow.com user rici said: "Serializing the stream of tokens
back into a character string, which is what gcc -E does, is not required or
even mentioned by the standard, and does not form part of the translation
process specified by the standard".

Hence, per C11 the 105207 is "not a problem".

However, per quality-of-implementation matter maybe it will be useful to make
-E produce the output after splicing is done (i.e. xxx #error). What do you
think?

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

* [Bug preprocessor/105207] Translation phase 2: splicing physical source lines to form logical source lines may not work
  2022-04-09 21:49 [Bug c/105207] New: C preprocessor: splicing physical source lines to form logical source lines may not work pavel.morozkin at gmail dot com
                   ` (3 preceding siblings ...)
  2022-04-11 22:16 ` pavel.morozkin at gmail dot com
@ 2022-12-10  7:18 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-10  7:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105207

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 55242.

*** This bug has been marked as a duplicate of bug 55242 ***

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

end of thread, other threads:[~2022-12-10  7:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-09 21:49 [Bug c/105207] New: C preprocessor: splicing physical source lines to form logical source lines may not work pavel.morozkin at gmail dot com
2022-04-09 21:58 ` [Bug c/105207] " pavel.morozkin at gmail dot com
2022-04-09 22:22 ` [Bug c/105207] Translation phase 2: " pavel.morozkin at gmail dot com
2022-04-10  0:15 ` [Bug preprocessor/105207] " pinskia at gcc dot gnu.org
2022-04-11 22:16 ` pavel.morozkin at gmail dot com
2022-12-10  7:18 ` pinskia 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).