BUILD: bug: make BUG_ON() void to avoid a rare warning
authorWilly Tarreau <w@1wt.eu>
Mon, 4 Sep 2023 14:42:53 +0000 (16:42 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 Sep 2023 17:38:51 +0000 (19:38 +0200)
commit17a7baca070f700ffa05ee8245648e88f921386b
treee006593d74bd7713acf7fff3a23133fc4c987196
parent88988bb06ccadb1c5486d1e61d9aa6c75e36a404
BUILD: bug: make BUG_ON() void to avoid a rare warning

When building without threads, the recently introduced BUG_ON(tid != 0)
turns to a constant expression that evaluates to 0 and that is not used,
resulting in this warning:

  src/connection.c: In function 'conn_free':
  src/connection.c:584:3: warning: statement with no effect [-Wunused-value]

This is because the whole thing is declared as an expression for clarity.
Make it return void to avoid this. No backport is needed.
include/haproxy/bug.h