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?
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/
Thanks!
-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";
Yeah, we figured that that was why they’re not supported in `-gnu89` mode, but I thought I’d ask just to be sure.
Then this isn't a valid bug report.
Oops, the mouse scroll wheel is too sensitive and I selected the wrong resolution :(.