From 27ef9a96affefa56277a39708298f850fc412497 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 21 Apr 2023 06:43:17 +0200 Subject: [PATCH] scan-build: treat as debug validate (cherry picked from commit bcf818744300fba9351fb2451b22a760221f7d99) --- src/suricata-common.h | 6 ++++++ src/util-validate.h | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/suricata-common.h b/src/suricata-common.h index 36ad48cf26..a46388290d 100644 --- a/src/suricata-common.h +++ b/src/suricata-common.h @@ -36,6 +36,12 @@ #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 #endif diff --git a/src/util-validate.h b/src/util-validate.h index 5f23fd75db..c0dac20b78 100644 --- a/src/util-validate.h +++ b/src/util-validate.h @@ -96,13 +96,6 @@ #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)