bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

adjust Bison to avoid HAVE_CONFIG_H all over the place


From: Paul Eggert
Subject: adjust Bison to avoid HAVE_CONFIG_H all over the place
Date: Thu, 12 Oct 2006 22:02:00 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

I installed this so that Bison can be simplified slightly, and
not have "#if HAVE_CONFIG_H" all over the place:

2006-10-12  Paul Eggert  <address@hidden>

        * bootstrap.conf (gnulib_modules): Add config-h.
        * djgpp/subpipe.c: Include <config.h> unconditionally; don't
        worry about HAVE_CONFIG_H.
        * lib/abitset.c: Likewise.
        * lib/bitset.c: Likewise.
        * lib/bitset_stats.c: Likewise.
        * lib/bitsetv-print.c: Likewise.
        * lib/bitsetv.c: Likewise.
        * lib/ebitset.c: Likewise.
        * lib/get-errno.c: Likewise.
        * lib/lbitset.c: Likewise.
        * lib/subpipe.c: Likewise.
        * lib/timevar.c: Likewise.
        * lib/vbitset.c: Likewise.
        * lib/bitset.c: Include "bitset.h" first, to test interface.
        * lib/bitset_stats.c: Include "bitset_stats.h" first.
        * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
        * lib/bitsetv.c: Include "bitsetv.h" first.
        * lib/get-errno.c: Include "get-errno.h" first.
        * m4/.cvsignore: Add config-h.m4.
        * tests/actions.at (Default %printer and %destructor for ...):
        Adjust expected line numbers in output to reflect removal of #if
        HAVE_CONFIG_H lines.
        * tests/glr-regression.at (Missed %merge type warnings when ...):
        Likewise.
        * tests/regression.at (Braced code in declaration in rules section):
        Likewise.
        * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
        * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
        Include <config.h> unconditionally.

Index: bootstrap.conf
===================================================================
RCS file: /cvsroot/bison/bison/bootstrap.conf,v
retrieving revision 1.2
diff -u -r1.2 bootstrap.conf
--- bootstrap.conf      1 Oct 2006 23:35:37 -0000       1.2
+++ bootstrap.conf      13 Oct 2006 04:59:59 -0000
@@ -20,7 +20,7 @@

 # gnulib modules used by this package.
 gnulib_modules='
-       argmatch configmake dirname error extensions fopen-safer
+       argmatch config-h configmake dirname error extensions fopen-safer
        getopt gettext hash inttypes malloc mbswidth obstack quote
        quotearg stdbool stpcpy strerror strtoul strverscmp unistd
        unistd-safer unlocked-io verify xalloc xalloc-die xstrndup
Index: djgpp/subpipe.c
===================================================================
RCS file: /cvsroot/bison/bison/djgpp/subpipe.c,v
retrieving revision 1.2
diff -u -r1.2 subpipe.c
--- djgpp/subpipe.c     22 Jan 2006 07:38:49 -0000      1.2
+++ djgpp/subpipe.c     13 Oct 2006 04:59:59 -0000
@@ -19,9 +19,7 @@
 /* Written by Juan Manuel Guerrero <address@hidden>. */


-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>

 #include "subpipe.h"

Index: lib/abitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/abitset.c,v
retrieving revision 1.12
diff -u -r1.12 abitset.c
--- lib/abitset.c       22 Jan 2006 07:38:49 -0000      1.12
+++ lib/abitset.c       13 Oct 2006 04:59:59 -0000
@@ -16,9 +16,7 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>

 #include "abitset.h"
 #include <stddef.h>
Index: lib/bitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitset.c,v
retrieving revision 1.18
diff -u -r1.18 bitset.c
--- lib/bitset.c        22 Jan 2006 07:38:49 -0000      1.18
+++ lib/bitset.c        13 Oct 2006 04:59:59 -0000
@@ -16,13 +16,12 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
+
+#include "bitset.h"

 #include <stdlib.h>
 #include <string.h>
-#include "bitset.h"
 #include "abitset.h"
 #include "lbitset.h"
 #include "ebitset.h"
Index: lib/bitset_stats.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitset_stats.c,v
retrieving revision 1.19
diff -u -r1.19 bitset_stats.c
--- lib/bitset_stats.c  22 Jan 2006 07:38:49 -0000      1.19
+++ lib/bitset_stats.c  13 Oct 2006 04:59:59 -0000
@@ -23,16 +23,15 @@
    operations get vectored through here and we then call the appropriate
    routines.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
+
+#include "bitset_stats.h"

 #include "bbitset.h"
 #include "abitset.h"
 #include "ebitset.h"
 #include "lbitset.h"
 #include "vbitset.h"
-#include "bitset_stats.h"
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
Index: lib/bitsetv-print.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitsetv-print.c,v
retrieving revision 1.5
diff -u -r1.5 bitsetv-print.c
--- lib/bitsetv-print.c 22 Jan 2006 07:38:49 -0000      1.5
+++ lib/bitsetv-print.c 13 Oct 2006 04:59:59 -0000
@@ -15,13 +15,12 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>

-#include <stdlib.h>
 #include "bitsetv-print.h"

+#include <stdlib.h>
+
 /*--------------------------------------------------------.
 | Display the MATRIX array of SIZE bitsets of size SIZE.  |
 `--------------------------------------------------------*/
Index: lib/bitsetv.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitsetv.c,v
retrieving revision 1.15
diff -u -r1.15 bitsetv.c
--- lib/bitsetv.c       22 Jan 2006 07:38:49 -0000      1.15
+++ lib/bitsetv.c       13 Oct 2006 04:59:59 -0000
@@ -15,13 +15,12 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>

-#include <stdlib.h>
 #include "bitsetv.h"

+#include <stdlib.h>
+

 /* Create a vector of N_VECS bitsets, each of N_BITS, and of
    type TYPE.  */
Index: lib/ebitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/ebitset.c,v
retrieving revision 1.18
diff -u -r1.18 ebitset.c
--- lib/ebitset.c       22 Jan 2006 07:38:49 -0000      1.18
+++ lib/ebitset.c       13 Oct 2006 04:59:59 -0000
@@ -16,11 +16,10 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>

 #include "ebitset.h"
+
 #include "obstack.h"
 #include <stdlib.h>
 #include <string.h>
Index: lib/get-errno.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/get-errno.c,v
retrieving revision 1.3
diff -u -r1.3 get-errno.c
--- lib/get-errno.c     22 Jan 2006 07:38:49 -0000      1.3
+++ lib/get-errno.c     13 Oct 2006 04:59:59 -0000
@@ -18,14 +18,12 @@

 /* Written by Paul Eggert.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <errno.h>
+#include <config.h>

 #include "get-errno.h"

+#include <errno.h>
+
 /* Get and set errno.  A source file that needs to set or get errno,
    but doesn't need to test for specific errno values, can use these
    functions to avoid namespace pollution.  For example, a file that
Index: lib/lbitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/lbitset.c,v
retrieving revision 1.20
diff -u -r1.20 lbitset.c
--- lib/lbitset.c       22 Jan 2006 07:38:49 -0000      1.20
+++ lib/lbitset.c       13 Oct 2006 04:59:59 -0000
@@ -16,11 +16,10 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>

 #include "lbitset.h"
+
 #include "obstack.h"
 #include <stddef.h>
 #include <stdlib.h>
Index: lib/subpipe.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/subpipe.c,v
retrieving revision 1.12
diff -u -r1.12 subpipe.c
--- lib/subpipe.c       15 Sep 2006 18:59:40 -0000      1.12
+++ lib/subpipe.c       13 Oct 2006 04:59:59 -0000
@@ -19,9 +19,7 @@
 /* Written by Paul Eggert <address@hidden>
    and Florian Krohm <address@hidden>.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>

 #include "subpipe.h"

Index: lib/timevar.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/timevar.c,v
retrieving revision 1.10
diff -u -r1.10 timevar.c
--- lib/timevar.c       22 Jan 2006 07:38:49 -0000      1.10
+++ lib/timevar.c       13 Oct 2006 04:59:59 -0000
@@ -16,9 +16,7 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>

 #if IN_GCC

Index: lib/vbitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/vbitset.c,v
retrieving revision 1.7
diff -u -r1.7 vbitset.c
--- lib/vbitset.c       22 Jan 2006 07:38:49 -0000      1.7
+++ lib/vbitset.c       13 Oct 2006 04:59:59 -0000
@@ -16,11 +16,10 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>

 #include "vbitset.h"
+
 #include <stdlib.h>
 #include <string.h>

Index: m4/.cvsignore
===================================================================
RCS file: /cvsroot/bison/bison/m4/.cvsignore,v
retrieving revision 1.21
diff -u -r1.21 .cvsignore
--- m4/.cvsignore       15 Sep 2006 18:59:40 -0000      1.21
+++ m4/.cvsignore       13 Oct 2006 04:59:59 -0000
@@ -1,5 +1,6 @@
 absolute-header.m4
 argmatch.m4
+config-h.m4
 dirname.m4
 dos.m4
 double-slash-root.m4
Index: tests/actions.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/actions.at,v
retrieving revision 1.70
diff -u -r1.70 actions.at
--- tests/actions.at    6 Oct 2006 06:57:00 -0000       1.70
+++ tests/actions.at    13 Oct 2006 04:59:59 -0000
@@ -896,7 +896,7 @@
 ]],
 [[Starting parse
 Entering state 0
-Reducing stack by rule 1 (line 37):
+Reducing stack by rule 1 (line 35):
 -> $$ = nterm start (1.1-1.1: Default printer for 'S' @ 1)
 Stack now 0
 Entering state 1
Index: tests/glr-regression.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/glr-regression.at,v
retrieving revision 1.40
diff -u -r1.40 glr-regression.at
--- tests/glr-regression.at     6 Oct 2006 06:57:00 -0000       1.40
+++ tests/glr-regression.at     13 Oct 2006 04:59:59 -0000
@@ -1760,10 +1760,10 @@
 ]])

 AT_CHECK([[bison -o glr-regr18.c glr-regr18.y]], 1, [],
-[glr-regr18.y:28.18-24: result type clash on merge function `merge': <type2> 
!= <type1>
-glr-regr18.y:27.18-24: previous declaration
-glr-regr18.y:29.13-19: result type clash on merge function `merge': <type3> != 
<type2>
-glr-regr18.y:28.18-24: previous declaration
+[glr-regr18.y:26.18-24: result type clash on merge function `merge': <type2> 
!= <type1>
+glr-regr18.y:25.18-24: previous declaration
+glr-regr18.y:27.13-19: result type clash on merge function `merge': <type3> != 
<type2>
+glr-regr18.y:26.18-24: previous declaration
 ])

 AT_CLEANUP
Index: tests/regression.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/regression.at,v
retrieving revision 1.109
diff -u -r1.109 regression.at
--- tests/regression.at 6 Oct 2006 06:57:00 -0000       1.109
+++ tests/regression.at 13 Oct 2006 04:59:59 -0000
@@ -1105,7 +1105,7 @@
 ]],
 [[Starting parse
 Entering state 0
-Reducing stack by rule 1 (line 22):
+Reducing stack by rule 1 (line 20):
 -> $$ = nterm start ()
 Stack now 0
 Entering state 1
Index: tests/atlocal.in
===================================================================
RCS file: /cvsroot/bison/bison/tests/atlocal.in,v
retrieving revision 1.18
diff -u -r1.18 atlocal.in
--- tests/atlocal.in    15 Sep 2006 18:59:40 -0000      1.18
+++ tests/atlocal.in    13 Oct 2006 04:59:59 -0000
@@ -11,7 +11,7 @@
 CFLAGS='@O0CFLAGS@ @WARNING_CFLAGS@ @WERROR_CFLAGS@'

 # We need `config.h'.
-CPPFLAGS="-DHAVE_CONFIG_H=1 -I$abs_top_builddir/lib @CPPFLAGS@"
+CPPFLAGS="-I$abs_top_builddir/lib @CPPFLAGS@"

 # Is the compiler GCC?
 GCC='@GCC@'
Index: tests/local.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/local.at,v
retrieving revision 1.16
diff -u -r1.16 local.at
--- tests/local.at      12 Mar 2006 15:26:05 -0000      1.16
+++ tests/local.at      13 Oct 2006 04:59:59 -0000
@@ -64,7 +64,7 @@
 m4_pushdef([AT_GLR_OR_PARAM_IF],
 [m4_bmatch([$3], [%glr-parser\|%parse-param], [$1], [$2])])
 m4_pushdef([AT_NAME_PREFIX],
-[m4_bmatch([$3], [%name-prefix=".*"], 
+[m4_bmatch([$3], [%name-prefix=".*"],
            [m4_bregexp([$3], [name-prefix="\([^"]*\)"], [\1])],
            [yy])])
 # yyerror receives the location if %location & %pure & (%glr or %parse-param).
@@ -148,13 +148,11 @@
 # meant to be compiled.
 m4_define([AT_DATA_GRAMMAR_PROLOGUE],
 [[%{
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-  /* We don't need perfect functions for these tests. */
-# undef malloc
-# undef memcmp
-# undef realloc
-#endif
+#include <config.h>
+/* We don't need perfect functions for these tests. */
+#undef malloc
+#undef memcmp
+#undef realloc
 %}]
 ])





reply via email to

[Prev in Thread] Current Thread [Next in Thread]