]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] clang-plugin: suppress noisy remarks and fix SANITIZER macro conflict
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 5 Feb 2026 13:10:54 +0000 (13:10 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 5 Feb 2026 13:10:54 +0000 (13:10 +0000)
clang-plugin/printf_check.cc
clang-plugin/printf_check.h

index 24d7de0eef1a2582765cafad73a7889e3ea3d48a..39c6b2c8e201d4e02ae404211a121611304b769a 100644 (file)
@@ -384,14 +384,12 @@ public:
        bool VisitCallExpr(CallExpr *E)
        {
                if (E->getCalleeDecl() == nullptr) {
-                       print_remark("cannot get callee decl",
-                                                E, this->pcontext, this->ci);
+                       /* Cannot resolve callee - skip silently (common for templates) */
                        return true;
                }
                auto callee = dyn_cast<NamedDecl>(E->getCalleeDecl());
                if (callee == NULL) {
-                       print_remark("cannot get named callee decl",
-                                                E, this->pcontext, this->ci);
+                       /* Not a named decl - skip silently */
                        return true;
                }
 
index 6e0b1d1657bbb90dac343fb108197f0b46637009..13497b9d26731d8cd9e4de68e84d6a3ed53ada1f 100644 (file)
 #define RSPAMD_PRINTF_CHECK_H
 
 #include <memory>
+
+/* Avoid conflict with LLVM's SANITIZER macro in Sanitizers.h */
+#undef SANITIZER
+
 #include "clang/AST/AST.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/Frontend/CompilerInstance.h"