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.
This commit is contained in:
Willy Tarreau 2024-04-10 09:07:31 +02:00
parent 2a9ccf5b25
commit e791b243f0

View File

@ -204,7 +204,7 @@ static __attribute__((noinline,noreturn,unused)) void abort_with_line(uint line)
*/ */
/* The macros below are for general use */ /* 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) # if defined(DEBUG_STRICT_ACTION) && (DEBUG_STRICT_ACTION < 1)
/* Lowest level: BUG_ON() warns, WARN_ON() warns, CHECK_IF() warns */ /* 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__) # 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__)