[compiler-rt] [sanitizer_common][AIX] Use scoped pragma to suppress atomic alignment warnings (PR #139272)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 9 07:33:53 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 HEAD~1 HEAD --extensions h -- compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h b/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h
index c2b106015..fded66546 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h
@@ -17,13 +17,13 @@
// Helper to suppress warnings related to 8-byte atomic accesses when the target
// is 32-bit AIX (where such accesses use libatomic).
#if defined(_AIX) && !defined(__powerpc64__) && defined(__clang__)
-#define SANITIZER_IGNORE_ATOMIC_ALIGNMENT_BEGIN \
- _Pragma("clang diagnostic push") \
- _Pragma("clang diagnostic ignored \"-Watomic-alignment\"")
-#define SANITIZER_IGNORE_ATOMIC_ALIGNMENT_END _Pragma("clang diagnostic pop")
+# define SANITIZER_IGNORE_ATOMIC_ALIGNMENT_BEGIN \
+ _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Watomic-alignment\"")
+# define SANITIZER_IGNORE_ATOMIC_ALIGNMENT_END _Pragma("clang diagnostic pop")
#else
-#define SANITIZER_IGNORE_ATOMIC_ALIGNMENT_BEGIN
-#define SANITIZER_IGNORE_ATOMIC_ALIGNMENT_END
+# define SANITIZER_IGNORE_ATOMIC_ALIGNMENT_BEGIN
+# define SANITIZER_IGNORE_ATOMIC_ALIGNMENT_END
#endif
namespace __sanitizer {
``````````
</details>
https://github.com/llvm/llvm-project/pull/139272
More information about the llvm-commits
mailing list