]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: debug: make BUG_ON() catch build errors even without DEBUG_STRICT
authorWilly Tarreau <w@1wt.eu>
Mon, 5 Feb 2024 14:06:05 +0000 (15:06 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 5 Feb 2024 14:09:37 +0000 (15:09 +0100)
commitbc70b385fdbc06cbb83ea0404d2836a434311380
tree6c69796840a058cd886a9f3f4a001230512d2020
parentbe0165b24951f68e63b327179babebed399f62ee
MINOR: debug: make BUG_ON() catch build errors even without DEBUG_STRICT

As seen in previous commit 59acb27001 ("BUILD: quic: Variable name typo
inside a BUG_ON()."), it can sometimes happen that with DEBUG forced
without DEBUG_STRICT, BUG_ON() statements are ignored. Sadly, it means
that typos there are not even build-tested.

This patch makes these statements reference sizeof(cond) to make sure
the condition is parsed. This doesn't result in any code being emitted,
but makes sure the expression is correct so that an issue such as the one
above will fail to build (which was verified).

This may be backported as it can help spot failed backports as well.
include/haproxy/bug.h