From: Victor Julien Date: Fri, 21 Apr 2023 04:43:17 +0000 (+0200) Subject: scan-build: treat as debug validate X-Git-Tag: suricata-6.0.12~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27ef9a96affefa56277a39708298f850fc412497;p=thirdparty%2Fsuricata.git scan-build: treat as debug validate (cherry picked from commit bcf818744300fba9351fb2451b22a760221f7d99) --- 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)