[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with create_pipe_bidi
Joel E. Denny
Re: Help with create_pipe_bidi
Mon, 14 Dec 2009 18:43:04 -0500 (EST)
Alpine 1.00 (DEB 882 2007-12-20)
On Mon, 7 Sep 2009, Joel E. Denny wrote:
> On Mon, 7 Sep 2009, Akim Demaille wrote:
> > I can understand the concerns of Paul wrt the space-footprint of assert,
> I'm probably showing my ignorance here, but are we talking about the size
> of the bison executable? I didn't know what Paul meant by "heavyweight".
> On my system, src/bison increases from 988K to 1000K when I adjust
> src/system.h as follows:
> -static inline void
> -aver (bool assertion)
> - if (! assertion)
> - abort ();
> +#include <assert.h>
> +#define aver assert
> After stripping, it's 300K and 312K. Will anyone be bothered by 12K?
> > that's why I meant to twist the meaning of NDEBUG into "smaller foot-print".
> > I would make --disable-asserts equivalent to NDEBUG, so it would move from
> > classical assert to our current aver.
> > We can also provide a three-state --disable-asserts:
> > - yes: fully blown assert,
> > - no: our current aver, same as NDEBUG,
> > - totally: completely remove the assertions.
> During development, assert's output could prove helpful. Also, if a user
> ever sees an assertion failure, it might be nice that he can report the
> assert output to bug-bison. I can also understand the motivation to
> suppress NDEBUG's effect. So, assert ignoring NDEBUG seems good to me.
> I don't yet see much motivation for other options, but I'm not opposed to
> bison providing them if you think people would find them useful.
I want assert's output as it can facilitate development and bug reporting,
so I pushed the following to master, branch-2.5, and branch-2.4.2. I
decided to simply do `#define aver assert'. I also added gnulib's assert
module. We can address the remaining concerns later once we've figured
out what's really needed.
Does anyone feel that these changes are NEWS-worthy?
>From ca01f454f01645533622a59ef0df335ee07679e5 Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Mon, 14 Dec 2009 18:04:57 -0500
Subject: [PATCH] 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.
ChangeLog | 7 +++++++
bootstrap.conf | 12 ++++++------
m4/.cvsignore | 1 +
m4/.gitignore | 1 +
src/system.h | 25 +++++++++++++++++--------
5 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 549b084..e465744 100644
@@ -1,5 +1,12 @@
2009-12-14 Joel E. Denny <address@hidden>
+ 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 <address@hidden>
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
@@ -17,12 +17,12 @@
# gnulib modules used by this package.
- 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/src/system.h b/src/system.h
index 8ea5653..8d2358c 100644
@@ -123,17 +123,26 @@ typedef size_t uintptr_t;
| Assertions. |
-/* <assert.h>'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 <assert.h>'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
+ <assert.h>'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 ();
+#define aver assert
|[Prev in Thread]
||[Next in Thread]|
- Re: Help with create_pipe_bidi,
Joel E. Denny <=