[libcxx-commits] [PATCH] D93316: [libc++] Fix extern C for __sanitizer_annotate_contiguous_container() (for gcc)

Azat Khuzhin via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 15 10:21:07 PST 2020

azat created this revision.
azat requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

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();


  $ 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();

  rG LLVM Github Monorepo



Index: libcxx/include/__config
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -1082,7 +1082,7 @@
-_LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
+extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
   const void *, const void *, const void *, const void *);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93316.311959.patch
Type: text/x-patch
Size: 440 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201215/68debd6a/attachment.bin>

More information about the libcxx-commits mailing list