[clang-tools-extra] [clang-tidy] Added bugprone-unsequenced-global-accesses check (PR #130421)
Áron Hárnási via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 10 12:36:39 PDT 2025
================
@@ -0,0 +1,72 @@
+.. title:: clang-tidy - bugprone-conflicting-global-accesses
+
+bugprone-conflicting-global-accesses
+====================================
+
+Finds conflicting accesses on global variables.
+
+Modifying twice or reading and modifying a memory location without a
+defined sequence of the operations is either undefined behavior or has
+unspecified order. This checker is similar to the -Wunsequenced clang warning,
+however it only looks at global variables and therefore can find conflicting
+actions recursively inside functions as well.
----------------
ConcreteCactus wrote:
Right, I wasn't sure whether to include/exclude `-Wunsequenced`. I removed the code parts that excluded flagging those cases, and noted later in the documentation that there could be some overlap.
https://github.com/llvm/llvm-project/pull/130421
More information about the cfe-commits
mailing list