[clang] [compiler-rt] [ASan] Document define to disable container overflow checks at compile time. (PR #163468)

Dan Blackwell via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 02:33:42 PST 2025


DanBlackwell wrote:

This is also failing on macOS. I'm concerned that this change is now causing a build error to anyone that includes a C++ container and `common_interface_defs.h` in the same TU:
```
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__config:1095:43: note: previous declaration is here
 1095 | extern "C" _LIBCPP_EXPORTED_FROM_ABI void __sanitizer_annotate_double_ended_contiguous_container(
      |                                           ^
In file included from /Users/ec2-user/jenkins/workspace/llvm.org/clang-stage1-RA/llvm-project/compiler-rt/test/asan/TestCases/disable_container_overflow_checks.cpp:21:
/Users/ec2-user/jenkins/workspace/llvm.org/clang-stage1-RA/clang-build/lib/clang/22/include/sanitizer/common_interface_defs.h:306:1: error: 'internal_linkage' attribute does not appear on the first declaration
  306 | __sanitizer_verify_double_ended_contiguous_container(const void *storage_beg,
      | ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__config:1098:1: note: previous declaration is here
 1098 | __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, const void*, const void*);
      | ^
3 errors generated.
```

Sorry to say it, but I think this should be reverted. Then in order to reland:
1. Land a change to __ identifiers so that libcxx can include `common_interface_defs.h` directly
2. Land the change to libcxx to use `common_interface_defs.h`
3. Reland this change

https://github.com/llvm/llvm-project/pull/163468


More information about the llvm-commits mailing list