From f163cbfb7f893a06d158880a753cad01908143d8 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 24 Oct 2024 15:04:25 +0200 Subject: [PATCH] BUILD: debug: silence a build warning with threads disabled Commit 091de0f9b2 ("MINOR: debug: slightly change the thread_dump_pointer signification") caused the following warning to be emitted when threads are disabled: src/debug.c: In function 'ha_thread_dump_one': src/debug.c:359:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] Let's just disguise the pointer to silence it. It should be backported where the patch above was backported, since it was part of a series aiming at making thread dumps more exploitable from core dumps. --- src/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index 49049f6dc0..0d569d6c88 100644 --- a/src/debug.c +++ b/src/debug.c @@ -348,7 +348,7 @@ void ha_thread_dump_one(int thr, int from_signal) } leave: /* end of dump, setting the buffer to 0x1 will tell the caller we're done */ - HA_ATOMIC_OR((ulong*)&ha_thread_ctx[thr].thread_dump_buffer, 0x1UL); + HA_ATOMIC_OR((ulong*)DISGUISE(&ha_thread_ctx[thr].thread_dump_buffer), 0x1UL); } /* Triggers a thread dump from thread , either directly if it's the