]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: debug: make gcc not complain on the ABORT_NOW() macro
authorWilly Tarreau <w@1wt.eu>
Tue, 14 May 2019 15:22:28 +0000 (17:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 14 May 2019 15:22:28 +0000 (17:22 +0200)
On recent gcc versions with the null-deref checks, ABORT_NOW() rightfully
emits such a warning. But here it's on purpose. Simply changing the memory
address to 1 makes gcc happy.

include/common/debug.h

index 325ef8396bd9ea75f26349159fb99b139c8dbdd8..8f6d1234250ea68c804aceb25f1c31cfdbeda766 100644 (file)
@@ -40,7 +40,7 @@
 /* This abort is more efficient than abort() because it does not mangle the
  * stack and stops at the exact location we need.
  */
-#define ABORT_NOW() (*(volatile int*)0=0)
+#define ABORT_NOW() (*(volatile int*)1=0)
 
 /* this one is provided for easy code tracing.
  * Usage: TRACE(strm||0, fmt, args...);