]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: bug: Fix error when compiling with -DDEBUG_STRICT_NOCRASH
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 3 Dec 2021 07:58:22 +0000 (08:58 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 3 Dec 2021 07:58:28 +0000 (08:58 +0100)
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.

include/haproxy/bug.h

index 45c97ba6737394d31202256296c1070036db269f..52a1ebe6b4bf3894432608c816f033e5b4915cd6 100644 (file)
@@ -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__)