From: Christopher Faulet Date: Fri, 3 Dec 2021 07:58:22 +0000 (+0100) Subject: BUILD: bug: Fix error when compiling with -DDEBUG_STRICT_NOCRASH X-Git-Tag: v2.6-dev1~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6ae912b04a38a544b2d37f549c7f86ae51e929c;p=thirdparty%2Fhaproxy.git BUILD: bug: Fix error when compiling with -DDEBUG_STRICT_NOCRASH ha_backtrace_to_stderr() must be declared in CRASH_NOW() macro whe HAProxy is compiled with DEBUG_STRICT_NOCRASH. Otherwise an error is reported during compilation: include/haproxy/bug.h:58:26: error: implicit declaration of function ‘ha_backtrace_to_stderr’ [-Werror=implicit-function-declaration] 58 | #define CRASH_NOW() do { ha_backtrace_to_stderr(); } while (0) This patch must be backported as far as 2.4. --- diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h index 45c97ba673..52a1ebe6b4 100644 --- a/include/haproxy/bug.h +++ b/include/haproxy/bug.h @@ -55,7 +55,7 @@ #if defined(DEBUG_STRICT) #define CRASH_NOW() ABORT_NOW() #else -#define CRASH_NOW() do { ha_backtrace_to_stderr(); } while (0) +#define CRASH_NOW() do { extern void ha_backtrace_to_stderr(void); ha_backtrace_to_stderr(); } while (0) #endif #define BUG_ON(cond) _BUG_ON(cond, __FILE__, __LINE__)