BUILD: debug: silence a build warning with threads disabled
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Oct 2024 13:04:25 +0000 (15:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Oct 2024 14:54:28 +0000 (16:54 +0200)
commit9ec0260698a2aab784204bbcb13f0f00987277c9
tree3b18070ab1330b87cc1b6c70b513c2a1150ae4eb
parent38c874bad691fc74a300817d1e85f3a331d4a6b4
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.

(cherry picked from commit f163cbfb7f893a06d158880a753cad01908143d8)
[wt: s/MT_LIST_FOR_EACH_ENTRY_LOCKED/mt_list_for_each_entry_safe/ with
     two backup elements in 3.0]
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/cfgparse.c
src/debug.c