I feel uncomfortable with the fact that aver is silent, so I'd
prefer that
aver == assert in !NDEBUG mode, and becomes the original aver
implementation
otherwise. Something like:
/* <assert.h>'s assertions are heavyweight and can be disabled too
easily, but deliver more information on failure. So use aver. See
discussions at
<http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00080.html
>
<http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00111.html
>.
*/
#if defined NDEBUG
static inline void
aver (bool assertion)
{
if (! assertion)
abort ();
}
#else
# include <assert.h>
# define aver assert
#endif
So how useful would --disable-asserts be for Bison? Is our goal to
hide
these debugging messages from the end user but not really remove the
run-time cost? If not, then maybe aver should just implement assert
without allowing NDEBUG to affect it.