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

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 15 14:22:58 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- compiler-rt/test/asan/TestCases/disable_container_overflow_checks.cpp compiler-rt/lib/asan/asan_errors.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/test/asan/TestCases/disable_container_overflow_checks.cpp b/compiler-rt/test/asan/TestCases/disable_container_overflow_checks.cpp
index c41e9bfa8..1ef3e79a6 100644
--- a/compiler-rt/test/asan/TestCases/disable_container_overflow_checks.cpp
+++ b/compiler-rt/test/asan/TestCases/disable_container_overflow_checks.cpp
@@ -3,19 +3,19 @@
 // RUN: %clangxx_asan -O %s -o %t
 // RUN: not %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
 //
-// Test overflow checks can be disabled at runtime with 
+// Test overflow checks can be disabled at runtime with
 // ASAN_OPTIONS=detect_container_overflow=0
 // RUN: %env_asan_opts=detect_container_overflow=0 %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-NOCRASH %s
 //
-// Illustrate use of -D__ASAN_DISABLE_CONTAINER_OVERFLOW__ flag to suppress 
+// Illustrate use of -D__ASAN_DISABLE_CONTAINER_OVERFLOW__ flag to suppress
 // overflow checks at compile time.
 // RUN: %clangxx_asan -D__ASAN_DISABLE_CONTAINER_OVERFLOW__ -O %s -o %t-no-overflow
 // RUN: %run %t-no-overflow crash 2>&1 | FileCheck --check-prefix=CHECK-NOCRASH %s
 //
 
 #include <assert.h>
-#include <string.h>
 #include <stdio.h>
+#include <string.h>
 
 // public definition of __sanitizer_annotate_contiguous_container
 #include "sanitizer/common_interface_defs.h"
@@ -42,7 +42,7 @@ int main(int argc, char **argv) {
   int retval = 0;
   assert(argc == 2);
   if (!strcmp(argv[1], "crash"))
-    retval=TestCrash();
+    retval = TestCrash();
 
   printf("Exiting main\n");
 

``````````

</details>


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


More information about the cfe-commits mailing list