[clang] [clang][analyzer] fix false positive of BlockInCriticalSectionChecker (PR #126752)

via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 12 04:45:39 PST 2025


================
@@ -145,6 +145,92 @@ using MutexDescriptor =
     std::variant<FirstArgMutexDescriptor, MemberMutexDescriptor,
                  RAIIMutexDescriptor>;
 
+class NonBlockOpenVisitor : public BugReporterVisitor {
+private:
+  const VarRegion *VR;
+  const CallExpr *OpenCallExpr;
+  int O_NONBLOCKV;
----------------
whisperity wrote:

My suggestion is to call this `int` here something else. Maybe `int ValueOfONonBlockVFlag; or just `int ValueO_NONBLOCKV;`. Something that prevents an accidental expansion to invalid code `int 8;` or something in this file.

Getting the value at runtime from the target architecture and putting it behind this variable is not a problem to do. The only concern here is the name of this variable.

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


More information about the cfe-commits mailing list