X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/3b2942e671eadc31ca5cacf4c2965a1cac4edf04..49976d5c45048312c97c4eec4b607660444642a9:/src/system.h?ds=sidebyside diff --git a/src/system.h b/src/system.h index ba0aea3e..c5a685bc 100644 --- a/src/system.h +++ b/src/system.h @@ -1,12 +1,11 @@ /* System-dependent definitions for Bison. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free - Software Foundation, Inc. + Copyright (C) 2000-2007, 2009-2010 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef BISON_SYSTEM_H #define BISON_SYSTEM_H @@ -59,7 +57,6 @@ typedef size_t uintptr_t; | Gnulib. | `---------*/ -#include <stpcpy.h> #include <unlocked-io.h> #include <verify.h> #include <xalloc.h> @@ -125,14 +122,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. */ -static inline void -aver (bool assertion) -{ - if (! assertion) - abort (); -} +/* 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 + <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00080.html> + <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00111.html>. + + 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 + <http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00013.html>. + + For now, we use assert but we call it aver throughout Bison in case + we later wish to try another scheme. +*/ +#include <assert.h> +#define aver assert /*-----------.