From: Willy Tarreau Date: Wed, 10 Apr 2024 07:07:31 +0000 (+0200) Subject: BUG/MINOR: debug: make sure DEBUG_STRICT=0 does work as documented X-Git-Tag: v3.0-dev8~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e791b243f04369ee8c6b2ff883bf31bde955019f;p=thirdparty%2Fhaproxy.git BUG/MINOR: debug: make sure DEBUG_STRICT=0 does work as documented Setting DEBUG_STRICT=0 only validates the defined(DEBUG_STRICT) test regarding DEBUG_STRICT_ACTION, which is equivalent to DEBUG_STRICT>=0. Let's make sure the test checks for >0 so that DEBUG_STRICT=0 properly disables DEBUG_STRICT. --- diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h index af086ef8df..b89ed22247 100644 --- a/include/haproxy/bug.h +++ b/include/haproxy/bug.h @@ -204,7 +204,7 @@ static __attribute__((noinline,noreturn,unused)) void abort_with_line(uint line) */ /* The macros below are for general use */ -#if defined(DEBUG_STRICT) +#if defined(DEBUG_STRICT) && (DEBUG_STRICT > 0) # if defined(DEBUG_STRICT_ACTION) && (DEBUG_STRICT_ACTION < 1) /* Lowest level: BUG_ON() warns, WARN_ON() warns, CHECK_IF() warns */ # define BUG_ON(cond, ...) _BUG_ON (cond, __FILE__, __LINE__, 2, "WARNING: bug ", " (not crashing but process is untrusted now, please report to developers)", __VA_ARGS__)