Skip to content

Commit 6340f89

Browse files
azatldionne
authored andcommitted
[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
1 parent f710bb7 commit 6340f89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcxx/include/__config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ typedef unsigned int char32_t;
10821082
#endif
10831083

10841084
#ifndef _LIBCPP_HAS_NO_ASAN
1085-
_LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
1085+
extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
10861086
const void *, const void *, const void *, const void *);
10871087
#endif
10881088

0 commit comments

Comments
 (0)