From: Aurelien DARRAGON Date: Mon, 5 Feb 2024 13:41:16 +0000 (+0100) Subject: BUILD: debug: remove leftover parentheses in ABORT_NOW() X-Git-Tag: v3.0-dev3~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=be0165b24951f68e63b327179babebed399f62ee;p=thirdparty%2Fhaproxy.git BUILD: debug: remove leftover parentheses in ABORT_NOW() Since d480b7b ("MINOR: debug: make ABORT_NOW() store the caller's line number when using abort"), building with 'DEBUG_USE_ABORT' fails with: |In file included from include/haproxy/api.h:35, | from include/haproxy/activity.h:26, | from src/ev_poll.c:20: |include/haproxy/thread.h: In function ‘ha_set_thread’: |include/haproxy/bug.h:107:47: error: expected ‘;’ before ‘_with_line’ | 107 | #define ABORT_NOW() do { DUMP_TRACE(); abort()_with_line(__LINE__); } while (0) | | ^~~~~~~~~~ |include/haproxy/bug.h:129:25: note: in expansion of macro ‘ABORT_NOW’ | 129 | ABORT_NOW(); \ | | ^~~~~~~~~ |include/haproxy/bug.h:123:9: note: in expansion of macro ‘__BUG_ON’ | 123 | __BUG_ON(cond, file, line, crash, pfx, sfx) | | ^~~~~~~~ |include/haproxy/bug.h:174:30: note: in expansion of macro ‘_BUG_ON’ | 174 | # define BUG_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 3, "FATAL: bug ", "") | | ^~~~~~~ |include/haproxy/thread.h:201:17: note: in expansion of macro ‘BUG_ON’ | 201 | BUG_ON(!thr->ltid_bit); | | ^~~~~~ |compilation terminated due to -Wfatal-errors. |make: *** [Makefile:1006: src/ev_poll.o] Error 1 This is because of a leftover: abort()_with_line(__LINE__); ^^ Fixing it by removing the extra parentheses after 'abort' since the abort() call is now performed under abort_with_line() helper function. This was raised by Ilya in GH #2440. No backport is needed, unless the above commit gets backported. --- diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h index bee4dab125..54308c66c2 100644 --- a/include/haproxy/bug.h +++ b/include/haproxy/bug.h @@ -104,7 +104,7 @@ static __attribute__((noinline,noreturn,unused)) void abort_with_line(uint line) abort(); } -#define ABORT_NOW() do { DUMP_TRACE(); abort()_with_line(__LINE__); } while (0) +#define ABORT_NOW() do { DUMP_TRACE(); abort_with_line(__LINE__); } while (0) #else /* More efficient than abort() because it does not mangle the * stack and stops at the exact location we need.