]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
scan-build: treat as debug validate
authorVictor Julien <vjulien@oisf.net>
Fri, 21 Apr 2023 04:43:17 +0000 (06:43 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 25 Apr 2023 09:36:37 +0000 (11:36 +0200)
(cherry picked from commit bcf818744300fba9351fb2451b22a760221f7d99)

src/suricata-common.h
src/util-validate.h

index 36ad48cf26cb82c2acdfa34e195f8a1a8c71ffd4..a46388290db72d0284f8515d61b7388ad9423486 100644 (file)
 #define _GNU_SOURCE
 #define __USE_GNU
 
+#if defined(__clang_analyzer__)
+/* clang analyzer acts as DEBUG_VALIDATION in some places, so
+ * force this so #ifdef DEBUG_VALIDATION code gets included */
+#define DEBUG_VALIDATION 1
+#endif
+
 #if HAVE_CONFIG_H
 #include <autoconf.h>
 #endif
index 5f23fd75dbe9844fbcef3e126069891bb2851282..c0dac20b78be49c3faee614af57d6a017389936a 100644 (file)
 
 #define DEBUG_VALIDATE_BUG_ON(exp) BUG_ON((exp))
 
-#elif defined(__clang_analyzer__)
-
-#define DEBUG_ASSERT_FLOW_LOCKED(f)
-#define DEBUG_VALIDATE_FLOW(f)
-#define DEBUG_VALIDATE_PACKET(p)
-#define DEBUG_VALIDATE_BUG_ON(exp) BUG_ON((exp))
-
 #else /* DEBUG_VALIDATE */
 
 #define DEBUG_ASSERT_FLOW_LOCKED(f)