]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEBUG: cleanup BUG_ON() configuration
authorWilly Tarreau <w@1wt.eu>
Fri, 25 Feb 2022 07:45:52 +0000 (08:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Feb 2022 10:55:47 +0000 (11:55 +0100)
commitbe0dbba6ecda5c882ee4e0db4923f8a67e4a85e9
treeabe5c39578bbc52f7ea9f3d11ec9870a28e4324c
parent1ea8bc4c4841ac41be38209ddfb45afbd38829e0
DEBUG: cleanup BUG_ON() configuration

The BUG_ON() macro handling is complicated because it relies on a
conditional CRASH_NOW() macro whose definition depends on DEBUG_STRICT
and DEBUG_STRICT_NOCRASH. Let's rethink the whole thing differently,
and instead make the underlying _BUG_ON() macro take a crash argument
to decide whether to crash or not, as well as a prefix and a suffix for
the message, that will allow to distinguish between variants. Now the
suffix is set to a message explaining we don't crash when needed.
This also allows to get rid of the CRASH_NOW() macro and to define
much simpler new macros.
include/haproxy/bug.h