public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/114773] New: Raw string literals are not supported in C89 mode
@ 2024-04-18 18:19 rl.alt.accnt at gmail dot com
  2024-04-18 18:27 ` [Bug c/114773] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rl.alt.accnt at gmail dot com @ 2024-04-18 18:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114773
           Summary: Raw string literals are not supported in C89 mode
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rl.alt.accnt at gmail dot com
  Target Milestone: ---

I’m currently working on supporting raw string literals in C in Clang like GCC
does, and we noticed that GCC doesn’t support them in `-std=gnu89` mode, only
in `-std=gnu99` mode and later (https://godbolt.org/z/hahja6Y87). 

Is this intentional or a bug?

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

* [Bug c/114773] Raw string literals are not supported in C89 mode
  2024-04-18 18:19 [Bug c/114773] New: Raw string literals are not supported in C89 mode rl.alt.accnt at gmail dot com
@ 2024-04-18 18:27 ` pinskia at gcc dot gnu.org
  2024-04-18 18:29 ` rl.alt.accnt at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-18 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://gcc.gnu.org/gcc-4.5/changes.html

Looks like it is on purpose:
C++0x raw strings are supported for C++ and for C with -std=gnu99.



https://inbox.sourceware.org/gcc-patches/20080912132007.GA9666@hs20-bc2-1.build.redhat.com/

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

* [Bug c/114773] Raw string literals are not supported in C89 mode
  2024-04-18 18:19 [Bug c/114773] New: Raw string literals are not supported in C89 mode rl.alt.accnt at gmail dot com
  2024-04-18 18:27 ` [Bug c/114773] " pinskia at gcc dot gnu.org
@ 2024-04-18 18:29 ` rl.alt.accnt at gmail dot com
  2024-04-18 18:36 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rl.alt.accnt at gmail dot com @ 2024-04-18 18:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sirraide <rl.alt.accnt at gmail dot com> ---
Thanks!

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

* [Bug c/114773] Raw string literals are not supported in C89 mode
  2024-04-18 18:19 [Bug c/114773] New: Raw string literals are not supported in C89 mode rl.alt.accnt at gmail dot com
  2024-04-18 18:27 ` [Bug c/114773] " pinskia at gcc dot gnu.org
  2024-04-18 18:29 ` rl.alt.accnt at gmail dot com
@ 2024-04-18 18:36 ` jakub at gcc dot gnu.org
  2024-04-18 18:50 ` rl.alt.accnt at gmail dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-04-18 18:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
-std=gnu89 is meant for really old programs, and the raw string literal support
changes behavior, so it isn't a pure extension on what wasn't valid before,
e.g. consider
#define R
#define b
const char * square(void) {
    return R"(a"b"a)";
}
in -std=c89 or -std=gnu89 this is return "(aa)"; while in -std=gnu99 return
"a\"b\"a";

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

* [Bug c/114773] Raw string literals are not supported in C89 mode
  2024-04-18 18:19 [Bug c/114773] New: Raw string literals are not supported in C89 mode rl.alt.accnt at gmail dot com
                   ` (2 preceding siblings ...)
  2024-04-18 18:36 ` jakub at gcc dot gnu.org
@ 2024-04-18 18:50 ` rl.alt.accnt at gmail dot com
  2024-04-19 11:15 ` xry111 at gcc dot gnu.org
  2024-04-19 11:16 ` xry111 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rl.alt.accnt at gmail dot com @ 2024-04-18 18:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Sirraide <rl.alt.accnt at gmail dot com> ---
Yeah, we figured that that was why they’re not supported in `-gnu89` mode, but
I thought I’d ask just to be sure.

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

* [Bug c/114773] Raw string literals are not supported in C89 mode
  2024-04-18 18:19 [Bug c/114773] New: Raw string literals are not supported in C89 mode rl.alt.accnt at gmail dot com
                   ` (3 preceding siblings ...)
  2024-04-18 18:50 ` rl.alt.accnt at gmail dot com
@ 2024-04-19 11:15 ` xry111 at gcc dot gnu.org
  2024-04-19 11:16 ` xry111 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-04-19 11:15 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xry111 at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Then this isn't a valid bug report.

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

* [Bug c/114773] Raw string literals are not supported in C89 mode
  2024-04-18 18:19 [Bug c/114773] New: Raw string literals are not supported in C89 mode rl.alt.accnt at gmail dot com
                   ` (4 preceding siblings ...)
  2024-04-19 11:15 ` xry111 at gcc dot gnu.org
@ 2024-04-19 11:16 ` xry111 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-04-19 11:16 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |INVALID

--- Comment #6 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Oops, the mouse scroll wheel is too sensitive and I selected the wrong
resolution :(.

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

end of thread, other threads:[~2024-04-19 11:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-18 18:19 [Bug c/114773] New: Raw string literals are not supported in C89 mode rl.alt.accnt at gmail dot com
2024-04-18 18:27 ` [Bug c/114773] " pinskia at gcc dot gnu.org
2024-04-18 18:29 ` rl.alt.accnt at gmail dot com
2024-04-18 18:36 ` jakub at gcc dot gnu.org
2024-04-18 18:50 ` rl.alt.accnt at gmail dot com
2024-04-19 11:15 ` xry111 at gcc dot gnu.org
2024-04-19 11:16 ` xry111 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).