[all-commits] [llvm/llvm-project] 6340f8: [libc++] Fix extern C for __sanitizer_annotate_con...

Azat Khuzhin via All-commits all-commits at lists.llvm.org
Thu Dec 17 13:25:03 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6340f890bb86b6ec1e72047d4c4560ee0dfe6d90
      https://github.com/llvm/llvm-project/commit/6340f890bb86b6ec1e72047d4c4560ee0dfe6d90
  Author: Azat Khuzhin <a3at.mail at gmail.com>
  Date:   2020-12-17 (Thu, 17 Dec 2020)

  Changed paths:
    M libcxx/include/__config

  Log Message:
  -----------
  [libc++] Fix extern C for __sanitizer_annotate_contiguous_container() (for gcc)

gcc supports it only at the beginning:

    $ g++ -o /dev/null -c /tmp/test_extern.cpp
    $ cat /tmp/test_extern.cpp
    extern "C" __attribute__ ((__visibility__("default"))) int foo();

Otherwise:

    $ g++ -o /dev/null -c /tmp/test_extern.cpp
    /tmp/test_extern.cpp:1:52: error: expected unqualified-id before string constant
        1 | __attribute__ ((__visibility__("default"))) extern "C" int foo();
          |                                                    ^~~
    $ cat /tmp/test_extern.cpp
    __attribute__ ((__visibility__("default"))) extern "C" int foo();

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D93316




More information about the All-commits mailing list