Bug 23044 - Assertions with side effects
There are lots of spots in libabigail's source code where the argument
of the assert() call does have side effects. This is a problem
because when the code is compiled with the NDEBUG macro defined, the
assert call does nothing, so the side effects of its argument are then
suppressed, changing the behaviour of the program.
To handle this issue, this patch introduces the ABG_ASSERT macro which
is a wrapper around the assert call that enable the use of side
effects in its argument. The patch now uses that ABG_ASSERT macro
instead of using the assert call directly.
The patch also makes it so that the configure option accepts the
--disable-assert option so that the user can build libabigail with the
NDEBUG macro defined.
Tested by running the testsuite with and without the --disable-assert
option to configure.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
29 files changed: