Disable c asserts when building without "--enable-debug"
|Reported by:||Algunenano||Owned by:||Algunenano|
In our configure we try to disable C asserts when not building in debug mode:
AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug], [Enable debugging code and flags]), [ENABLE_DEBUG=1], [ENABLE_DEBUG=0]) if test $ENABLE_DEBUG -eq 1; then AC_DEFINE([PARANOIA_LEVEL], , [Enable use of memory checks]) CFLAGS="$CFLAGS -g" else AC_DEFINE([PARANOIA_LEVEL], , [Disable use of memory checks]) AC_DEFINE([NDEBUG], , [Disable C asserts]) fi
I don't know what
AC_DEFINE([NDEBUG], , [Disable C asserts]) is doing, probably nothing, but I still have asserts enabled in my release builds. I suggest adding
-DNDEBUG to the CPPFLAGS directly instead.
I'm considering this as an enhancement since someone might be surprised by the change on the default, but I believe this was the intention all along.