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.
This commit is contained in:
Christopher Faulet 2021-12-03 08:58:22 +01:00
parent af93d2fd70
commit d6ae912b04
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@
#if defined(DEBUG_STRICT) #if defined(DEBUG_STRICT)
#define CRASH_NOW() ABORT_NOW() #define CRASH_NOW() ABORT_NOW()
#else #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 #endif
#define BUG_ON(cond) _BUG_ON(cond, __FILE__, __LINE__) #define BUG_ON(cond) _BUG_ON(cond, __FILE__, __LINE__)