From: Joel E. Denny Date: Mon, 14 Dec 2009 23:04:57 +0000 (-0500) Subject: Enable assertion output and --disable-assert for configure. X-Git-Tag: v2.5_rc1~141 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1fb412cf39bc9e58f6046675c720dc6bbceec91;p=platform%2Fupstream%2Fbison.git Enable assertion output and --disable-assert for configure. * bootstrap.conf (gnulib_modules): Add assert module. * src/system.h (aver): Define as assert, and summarize the discussion on this issue. (cherry picked from commit ca01f454f01645533622a59ef0df335ee07679e5) --- diff --git a/ChangeLog b/ChangeLog index de7790c..cee393b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-12-14 Joel E. Denny + Enable assertion output and --disable-assert for configure. + * bootstrap.conf (gnulib_modules): Add assert module. + * src/system.h (aver): Define as assert, and summarize the + discussion on this issue. + +2009-12-14 Joel E. Denny + Expand GLR acronym in summary of Bison. Based on discussion with Akim Demaille starting at . diff --git a/bootstrap.conf b/bootstrap.conf index 1cef2f0..dff8d80 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -17,12 +17,12 @@ # gnulib modules used by this package. gnulib_modules=' - announce-gen argmatch config-h c-strcase configmake dirname error - extensions fopen-safer gendocs getopt-gnu gettext git-version-gen hash - inttypes javacomp-script javaexec-script maintainer-makefile malloc - mbswidth obstack quote quotearg stdbool stpcpy strerror strtoul - strverscmp unistd unistd-safer unlocked-io update-copyright unsetenv - verify warnings xalloc xalloc-die xstrndup + announce-gen argmatch assert config-h c-strcase configmake dirname + error extensions fopen-safer gendocs getopt-gnu gettext + git-version-gen hash inttypes javacomp-script javaexec-script + maintainer-makefile malloc mbswidth obstack quote quotearg stdbool + stpcpy strerror strtoul strverscmp unistd unistd-safer unlocked-io + update-copyright unsetenv verify warnings xalloc xalloc-die xstrndup ' # Additional xgettext options to use. Use "\\\newline" to break lines. diff --git a/m4/.cvsignore b/m4/.cvsignore index e8cf4d8..9012c37 100644 --- a/m4/.cvsignore +++ b/m4/.cvsignore @@ -1,6 +1,7 @@ 00gnulib.m4 absolute-header.m4 argmatch.m4 +assert.m4 config-h.m4 dirname.m4 dos.m4 diff --git a/m4/.gitignore b/m4/.gitignore index 810868c..ef6cd38 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -1,6 +1,7 @@ /00gnulib.m4 /absolute-header.m4 /argmatch.m4 +/assert.m4 /config-h.m4 /dirname.m4 /dos.m4 diff --git a/src/system.h b/src/system.h index 8ea5653..8d2358c 100644 --- a/src/system.h +++ b/src/system.h @@ -123,17 +123,26 @@ typedef size_t uintptr_t; | Assertions. | `-------------*/ -/* 's assertions are too heavyweight, and can be disabled - too easily, so use aver rather than assert. See discussions at +/* In the past, Bison defined aver to simply invoke abort in the case of + a failed assertion. The rationale was that 's assertions + were too heavyweight and could be disabled too easily. See + discussions at . + + However, normal assert output can be helpful during development and + in bug reports from users. Moreover, it's not clear now that + 's assertions are significantly heavyweight. Finally, if + users want to experiment with disabling assertions, it's debatable + whether it's our responsibility to stop them. See discussion + starting at + . + + For now, we use assert but we call it aver throughout Bison in case + we later wish to try another scheme. */ -static inline void -aver (bool assertion) -{ - if (! assertion) - abort (); -} +#include +#define aver assert /*-----------.