Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #71504

Re: C++ preprocessor and multi-line string literals

From boltar@nowhere.org
Newsgroups comp.lang.c++
Subject Re: C++ preprocessor and multi-line string literals
Date 2020-01-22 10:24 +0000
Organization Aioe.org NNTP Server
Message-ID <r097to$pfj$1@gioia.aioe.org> (permalink)
References <qvpvvf$h2p$1@dont-email.me> <r04bcm$32j$2@adenine.netfront.net> <789965ca-739a-48cd-940a-8cdb66f4fd40@googlegroups.com>

Show all headers | View raw


On Wed, 22 Jan 2020 02:11:24 -0800 (PST)
guinness.tony@gmail.com wrote:
>On Wednesday, 22 January 2020 09:58:35 UTC, bol...@nowhere.org  wrote:
>> On Tue, 21 Jan 2020 19:25:06 +0200
>> Paavo Helde <myfirstname@osa.pri.ee> wrote:
>> >On 21.01.2020 18:43, boltar@nowhere.org wrote:
>> >> Not with Clang you can't:
>> >>
>> >> t.c:3:27: warning: missing terminating '"' character [-Winvalid-pp-token]
>> >> #define GLSL_COMMON_FUNC R"#(
>> >>                            ^
>> >> t.c:7:1: error: expected identifier or '('
>> >> )#"
>> >> ^
>> >> t.c:7:3: warning: missing terminating '"' character [-Winvalid-pp-token]
>> >> )#"
>> >>
>> >> Is this a gcc extension?
>> >>
>> >
>> >https://godbolt.org/ shows that this compiles fine with clang 6.0.0 and 
>> >later. Clang 5.0.0 indeed fails - it looks like it's time to upgrade, 
>> >the current version is 9.0.0.
>> 
>> They can say it compiles fine all they like, I'm telling you it doesn't:
>> 
>> fenris$ clang -v
>> Apple LLVM version 10.0.1 (clang-1001.0.46.4)
>> Target: x86_64-apple-darwin18.7.0
>> Thread model: posix
>> InstalledDir: /Library/Developer/CommandLineTools/usr/bin
>> fenris$ cat t.c
>> #define GLSL_COMMON_FUNC R"#(
>> float func(float f) {
>> 	return 0.0;
>> >}
>> >)#"
>> 
>> int main()
>> {
>> 	return 0;
>> }
>> fenris$ cc t.c
>> t.c:1:27: warning: missing terminating '"' character [-Winvalid-pp-token]
>> #define GLSL_COMMON_FUNC R"#(
>>                           ^
>> t.c:4:1: error: expected expression
>> >}
>> ^
>> t.c:4:2: error: expected expression
>> >}
>>  ^
>> t.c:5:1: error: expected identifier or '('
>> >)#"
>> ^
>> t.c:5:4: warning: missing terminating '"' character [-Winvalid-pp-token]
>> >)#"
>>    ^
>> 2 warnings and 3 errors generated.
>> fenris$ mv t.c t.cc
>> fenris$ c++ t.cc
>> t.cc:1:27: warning: missing terminating '"' character [-Winvalid-pp-token]
>> #define GLSL_COMMON_FUNC R"#(
>>                           ^
>> t.cc:4:1: error: expected expression
>> >}
>> ^
>> t.cc:4:2: error: expected expression
>> >}
>>  ^
>> t.cc:5:1: error: expected unqualified-id
>> >)#"
>> ^
>> t.cc:5:4: warning: missing terminating '"' character [-Winvalid-pp-token]
>> >)#"
>>    ^
>> 2 warnings and 3 errors generated.
>
>It does if you use the C++ compiler (you're using the C compiler, above).

Are you blind? Try looking a bit harder.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

C++ preprocessor and multi-line string literals Paavo Helde <myfirstname@osa.pri.ee> - 2020-01-16 17:37 +0200
  Re: C++ preprocessor and multi-line string literals Öö Tiib <ootiib@hot.ee> - 2020-01-16 09:46 -0800
    Re: C++ preprocessor and multi-line string literals Manfred <noname@add.invalid> - 2020-01-16 22:49 +0100
      Re: C++ preprocessor and multi-line string literals Öö Tiib <ootiib@hot.ee> - 2020-01-16 14:43 -0800
        Re: C++ preprocessor and multi-line string literals Manfred <invalid@add.invalid> - 2020-01-17 01:24 +0100
          Re: C++ preprocessor and multi-line string literals Öö Tiib <ootiib@hot.ee> - 2020-01-16 16:38 -0800
            Re: C++ preprocessor and multi-line string literals Manfred <invalid@add.invalid> - 2020-01-17 03:27 +0100
  Re: C++ preprocessor and multi-line string literals legalize+jeeves@mail.xmission.com (Richard) - 2020-01-16 20:07 +0000
  Re: C++ preprocessor and multi-line string literals Juha Nieminen <nospam@thanks.invalid> - 2020-01-20 13:53 +0000
    Re: C++ preprocessor and multi-line string literals Paavo Helde <myfirstname@osa.pri.ee> - 2020-01-20 18:31 +0200
    Re: C++ preprocessor and multi-line string literals Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-20 18:19 +0100
      Re: C++ preprocessor and multi-line string literals Juha Nieminen <nospam@thanks.invalid> - 2020-01-21 08:24 +0000
        Re: C++ preprocessor and multi-line string literals boltar@nowhere.org - 2020-01-21 16:43 +0000
          Re: C++ preprocessor and multi-line string literals Paavo Helde <myfirstname@osa.pri.ee> - 2020-01-21 19:25 +0200
            Re: C++ preprocessor and multi-line string literals boltar@nowhere.org - 2020-01-22 09:58 +0000
              Re: C++ preprocessor and multi-line string literals guinness.tony@gmail.com - 2020-01-22 02:11 -0800
                Re: C++ preprocessor and multi-line string literals boltar@nowhere.org - 2020-01-22 10:24 +0000
                Re: C++ preprocessor and multi-line string literals James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-01-23 22:25 -0500
              Re: C++ preprocessor and multi-line string literals Paavo Helde <myfirstname@osa.pri.ee> - 2020-01-22 13:28 +0200
                Re: C++ preprocessor and multi-line string literals boltar@nowhere.org - 2020-01-22 12:07 +0000
                Re: C++ preprocessor and multi-line string literals Öö Tiib <ootiib@hot.ee> - 2020-01-22 05:33 -0800
                Re: C++ preprocessor and multi-line string literals boltar@nowhere.org - 2020-01-22 16:03 +0000
                Re: C++ preprocessor and multi-line string literals Öö Tiib <ootiib@hot.ee> - 2020-01-22 10:50 -0800
                Re: C++ preprocessor and multi-line string literals boltar@nowhere.org - 2020-01-23 09:22 +0000
                Re: C++ preprocessor and multi-line string literals Manfred <noname@add.invalid> - 2020-01-22 18:59 +0100
              Re: C++ preprocessor and multi-line string literals Juha Nieminen <nospam@thanks.invalid> - 2020-01-22 12:03 +0000

csiph-web