From 1f479b8aac0323e671fdb707769089e684c0c6bb Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 16 May 2025 16:12:12 +0200 Subject: [PATCH] BUILD: debug: mark ha_crash_now() as attribute(noreturn) Building on MIPS64 with clang16 incorrectly reports some uninitialized value warnings in stats-proxy.c due to some calls to ABORT_NOW() where the compiler didn't know the code wouldn't return. Let's properly mark the function as noreturn, and take this opportunity for also marking it unused to avoid possible warnings depending on the build options (if ABORT_NOW is not used). No backport needed though it will not harm. (cherry picked from commit 0a91c6dcaebd41ead51f3654ca96d564ccda32af) Signed-off-by: Willy Tarreau --- include/haproxy/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h index 1cf4333..068912a 100644 --- a/include/haproxy/bug.h +++ b/include/haproxy/bug.h @@ -68,7 +68,7 @@ #else // not x86 /* generic implementation, causes a segfault */ -static inline __attribute((always_inline)) void ha_crash_now(void) +static inline __attribute((always_inline,noreturn,unused)) void ha_crash_now(void) { #if __GNUC_PREREQ__(5, 0) #pragma GCC diagnostic push -- 1.7.10.4