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.
This commit is contained in:
Willy Tarreau 2024-10-24 15:04:25 +02:00
parent 5db761f709
commit f163cbfb7f
1 changed files with 1 additions and 1 deletions

View File

@ -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 <thr>, either directly if it's the