From: Victor Julien Date: Fri, 21 Apr 2023 04:43:17 +0000 (+0200) Subject: scan-build: treat as debug validate X-Git-Tag: suricata-7.0.0-rc2~372 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcf818744300fba9351fb2451b22a760221f7d99;p=thirdparty%2Fsuricata.git scan-build: treat as debug validate --- diff --git a/src/suricata-common.h b/src/suricata-common.h index 34eb0b7d57..a0912c2ce5 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 defined(__has_feature) #if __has_feature(address_sanitizer) #define SC_ADDRESS_SANITIZER 1 diff --git a/src/util-validate.h b/src/util-validate.h index 011e1bd0ae..c0dac20b78 100644 --- a/src/util-validate.h +++ b/src/util-validate.h @@ -96,15 +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)) -/* define macro so we also get #ifdef DEBUG_VALIDATION code */ -#define DEBUG_VALIDATION 1 - #else /* DEBUG_VALIDATE */ #define DEBUG_ASSERT_FLOW_LOCKED(f)