bison-patches
[Top][All Lists]
Advanced

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

patches to prepare for Bison 2.0b


From: Paul Eggert
Subject: patches to prepare for Bison 2.0b
Date: Sun, 24 Jul 2005 00:31:07 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

I installed this patch, to fix up a bunch of minor details before
Bison test version 2.0b can be released.  Most of these things
were caught by "make maintainer-distcheck".  I'll wait a bit
before generating the actual test release.

2005-07-24  Paul Eggert  <address@hidden>

        * NEWS: Version 2.0b.

        * etc/clcommit: Remove.  We weren't using it, and it failed
        "make maintainer-distcheck".
        * Makefile.maint: Merge from coreutils.
        (CVS_LIST, CVS_LIST_EXCEPT): New macros.
        (syntax-check-rules): Change list of rules as described below.
        (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
        (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
        (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
        (sc_trailing_space): New rules.
        (sc_xalloc_h_in_src): Remove.
        (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
        (sc_space_tab, sc_error_exit_success, sc_changelog):
        (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
        (makefile-check, po-check, author_mark_check):
        (makefile_path_separator_check, copyright-check):
        Use grep -n, to make it easier to find violations.
        Use CVS_LIST and CVS_LIST_EXCEPT.
        (header_regexp, h_re): Remove.
        (dd_c): New macro.
        (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
        (my-distcheck): Use more-modern GCC flags.
        (signatures, %.asc): Remove.
        (rel-files, announcement): Remove signatures.
        Restore old updating code, even though we don't use it, so
        that we're the same as coreutils.
        (alpha, beta, major): Depend on news-date-check.
        Make the upload commands.

        * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
        * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
        * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
        * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
        * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
        * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
        * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
        * tests/sets.at: Likewise.

        * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
        we comment out the Autoconf version number.
        * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
        it's error-prone and "make maintainer-distcheck" rejects it.

        * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
        Indent calls to "error" to pacify "make maintainer-distcheck",
        when the calls are not intended to be translated.
        * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.

        * src/Makefile.am (DEFS): Use +=, to pacify
        "make maintainer-distcheck".
        (bison_SOURCES): Add scan-skel.h.
        (sc_tight_scope): New rule, from coreutils.

        * src/files.c (src_extension, header_extension):
        Now static, not extern.
        * src/getargs.c (short_options): Likewise.
        * src/muscle_tab.c (muscle_table): Likewise.
        * src/parse-gram.y (current_class, current_type, current_prec):
        Likewise.
        * src/reader.c (grammar_end, previous_rule_end): Likewise.
        * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
        * src/main.c (main): Cast bindtextdomain and textdomain calls to
        void, to avoid warning when NLS is disabled.
        * src/output.c: Include scan-skel.h.
        (scan_skel): Remove decl, since scan-skel.h does this.
        (output_skeleton):
        Indent calls to "error" to pacify "make maintainer-distcheck".
        * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
        * src/reader.h (gram_end, gram_lineno): New decls to pacify
        "make maintainer-distcheck".
        * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
        (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
        (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
        (skel_lex_destroy, scan_skel): Move these decls to...
        * src/scan-skel.h: New file.
        * src/uniqstr.c (uniqstr_assert):
        Indent calls to "error" to pacify "make maintainer-distcheck".

        * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
        not @address@hidden

        * tests/torture.at: Revamp to avoid misuse of atoi that
        "make maintainer-distcheck" complained about.

Index: Makefile.maint
===================================================================
RCS file: /cvsroot/bison/bison/Makefile.maint,v
retrieving revision 1.18
diff -p -u -r1.18 Makefile.maint
--- Makefile.maint      22 May 2005 17:45:28 -0000      1.18
+++ Makefile.maint      24 Jul 2005 07:20:54 -0000
@@ -2,7 +2,7 @@
 # This Makefile fragment is shared between the coreutils,
 # CPPI, Bison, and Autoconf.
 
-## Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 ##
 ## 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
@@ -24,6 +24,7 @@
 ME := Makefile.maint
 
 # Do not save the original name or timestamp in the .tar.gz file.
+# Use --rsyncable if available.
 GZIP_ENV = \
   "--no-name --best$$( \
     case $$(gzip --help) in \
@@ -33,6 +34,20 @@ GZIP_ENV = \
 
 CVS = cvs
 
+CVS_LIST = sh -c ' \
+    (cvsu --find --types=AFGM $$*) 2>/dev/null || \
+    awk -F/ '\''{ \
+       if (!$$1 && $$3 !~ /^-/) { \
+         f=FILENAME; \
+         sub(/CVS\/Entries/, "", f); \
+         print f $$2; \
+       }}'\'' \
+      $$(find $${*-*} -name Entries -print) /dev/null \
+  ' dummy
+
+CVS_LIST_EXCEPT = \
+  $(CVS_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v 
ChangeLog; fi
+
 ifeq ($(origin prev_version_file), undefined)
   prev_version_file = .prev-version
 endif
@@ -69,126 +84,184 @@ local-checks-available = \
 
 local-check = $(filter-out $(local-checks-to-skip), $(local-checks-available))
 
-# Make sure C source files in src/ don't include xalloc.h directly,
-# since they all already include it via sys2.h.
-# It's not a big deal -- just aesthetics.
 .PHONY: $(syntax-check-rules)
 syntax-check-rules = \
   sc_cast_of_argument_to_free \
   sc_cast_of_x_alloc_return_value \
+  sc_cast_of_alloca_return_value \
   sc_changelog \
+  sc_dd_max_sym_length \
   sc_error_exit_success \
+  sc_file_system \
+  sc_obsolete_symbols \
+  sc_prohibit_atoi_atof \
+  sc_prohibit_jm_in_m4 \
+  sc_root_tests \
   sc_space_tab \
   sc_sun_os_names \
   sc_system_h_headers \
-  sc_unmarked_diagnostics \
-  sc_xalloc_h_in_src
+  sc_tight_scope \
+  sc_trailing_space \
+  sc_unmarked_diagnostics
 
 syntax-check: $(syntax-check-rules)
-#      @grep -E '#  *include <(limits|std(def|arg|bool))\.h>'          \
+#      @grep -nE '#  *include <(limits|std(def|arg|bool))\.h>'         \
 #          $$(find -type f -name '*.[chly]') &&                        \
 #        { echo '$(ME): found conditional include' 1>&2;               \
 #          exit 1; } || :
 
-#      grep -E '^#  *include <(string|stdlib)\.h>'                     \
+#      grep -nE '^#  *include <(string|stdlib)\.h>'                    \
 #          $(srcdir)/{lib,src}/*.[chy] &&                              \
 #        { echo '$(ME): FIXME' 1>&2;                                   \
 #          exit 1; } || :
 # FIXME: don't allow `#include .strings\.h' anywhere
 
-# Look for diagnostics that aren't marked for translation.
-# This won't find any for which error's format string is on a separate line.
-sc_unmarked_diagnostics:
-       @grep --exclude=$(srcdir)/src/shred.c -E                        \
-           '\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c     \
-         | grep -v '_(' &&                                             \
-         { echo '$(ME): found unmarked diagnostic(s)' 1>&2;            \
-           exit 1; } || :
-
 sc_cast_of_argument_to_free:
-       @grep -E '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] &&          \
+       @grep -nE '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] &&         \
          { echo '$(ME): don'\''t cast free argument' 1>&2;             \
            exit 1; } || :
 
 sc_cast_of_x_alloc_return_value:
-       @grep -E --exclude=$(srcdir)/lib/regex.c                        \
-           '\*\) *x(m|c|re)alloc\>' $(srcdir)/{lib,src}/*.[chy] &&     \
+       @grep -nE --exclude=$(srcdir)/lib/regex.c                       \
+           '\*\) *x(m|c|re)alloc\>'                                    \
+           $(srcdir)/{lib,src}/*.[chy] &&                              \
          { echo '$(ME): don'\''t cast x*alloc return value' 1>&2;      \
            exit 1; } || :
 
+sc_cast_of_alloca_return_value:
+       @grep -nE '\*\) *alloca\>'                                      \
+           $(srcdir)/src/*.[chy] &&                                    \
+         { echo '$(ME): don'\''t cast alloca return value' 1>&2;       \
+           exit 1; } || :
+
 sc_space_tab:
-       @( cvsu --list ) > /dev/null 2>&1 || : &&                       \
-         grep '[ ]     '                                               \
-            $$(cvsu --list | grep -vEf .x-$@ ) &&                      \
+       @grep -n '[ ]   '                                               \
+            $$($(CVS_LIST_EXCEPT)) &&                                  \
          { echo '$(ME): found SPACE-TAB sequence; remove the SPACE'    \
                1>&2; exit 1; } || :
 
+# Don't use the old ato* functions in `real' code.
+# They provide no error checking mechanism.
+# Instead, use strto* functions.
+sc_prohibit_atoi_atof:
+       @grep -nE '\<(ato[filq]|ato''ll)\>'                             \
+            $$($(CVS_LIST_EXCEPT)) &&                                  \
+         { echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' 
\
+               1>&2; exit 1; } || :
+
 # Using EXIT_SUCCESS as the first argument to error is misleading,
 # since when that parameter is 0, error does not exit.  Use `0' instead.
 sc_error_exit_success:
-       @grep -F 'error (EXIT_SUCCESS,'                                 \
+       @grep -nF 'error (EXIT_SUCCESS,'                                        
\
            $$(find -type f -name '*.[chly]') &&                        \
          { echo '$(ME): found error (EXIT_SUCCESS' 1>&2;               \
            exit 1; } || :
 
-# FIXME: merge this with sc_system_h_headers below.
-# xalloc.h is included via system.h, so should not be included
-# directly by any file in src/.
-sc_xalloc_h_in_src:
-       @if test -f $(srcdir)/src/sys2.h; then                          \
-         if grep 'xalloc\.h' $(srcdir)/src/*.c; then                   \
-           exit 1;                                                     \
-         fi;                                                           \
-       fi
+sc_file_system:
+       @grep -ni 'file''system'                                        \
+            $$($(CVS_LIST_EXCEPT)) &&                                  \
+         { echo '$(ME): found use of "file''system";'                  \
+           'rewrite to use "file system"' 1>&2;                        \
+           exit 1; } || :
+
+sc_obsolete_symbols:
+       @grep -nE '\<(HAVE_''FCNTL_H)\>'                                        
\
+            $$($(CVS_LIST_EXCEPT)) &&                                  \
+         { echo '$(ME): do not use HAVE_''FCNTL_H'                     \
+               1>&2; exit 1; } || :
 
 # FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
 
 # Each nonempty line must start with a year number, or a TAB.
 sc_changelog:
-       @grep '^[^12    ]' $$(find . -name ChangeLog -maxdepth 2) &&    \
+       @grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) &&    \
          { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2;  \
            exit 1; } || :
 
-header_regexp = \
-  alloca\
-  |closeout\
-  |ctype\
-  |dirent\
-  |errno\
-  |fcntl\
-  |inttypes\
-  |limits\
-  |locale\
-  |pathmax\
-  |std(lib|bool)\
-  |string\
-  |sys/(stat|dir|time)\
-  |time\
-  |unistd\
-  |utime\
-  |version-etc\
-  |xalloc
-h_re := $(shell echo '$(header_regexp)'|tr -d ' ')
+# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
+# with the strings from the two affected variables.
+dd_c = $(srcdir)/src/dd.c
+sc_dd_max_sym_length:
+ifneq ($(wildcard $(dd_c)),)
+       @len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
+                sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) )      \
+               |sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p'         \
+              | wc --max-line-length);                         \
+       max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
+             |tr -d '"' | wc --max-line-length);               \
+       if test "$$len" = "$$max"; then :; else                 \
+         echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2;      \
+         exit 1;                                               \
+       fi
+endif
+
+# Many m4 macros names once began with `jm_'.
+# On 2004-04-13, they were all changed to start with gl_ instead.
+# Make sure that none are inadvertently reintroduced.
+sc_prohibit_jm_in_m4:
+       @grep -nE 'jm_[A-Z]'                                            \
+               $$($(CVS_LIST) $(srcdir)/m4 |grep '\.m4$$') &&          \
+           { echo '$(ME): do not use jm_ in m4 macro names'            \
+             1>&2; exit 1; } || :
+
+sc_root_tests:
+       @t1=sc-root.expected; t2=sc-root.actual;                        \
+       grep -nl '^PRIV_CHECK_ARG=require-root'                         \
+         $$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1;           \
+       sed -n 's,      cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
+         $(srcdir)/tests/Makefile.am |sort > $$t2;                     \
+       diff -u $$t1 $$t2 || diff=1;                                    \
+       rm -f $$t1 $$t2;                                                \
+       test "$$diff"                                                   \
+         && { echo 'tests/Makefile.am: missing check-root action'>&2;  \
+              exit 1; } || :
+
+# Create a list of regular expressions matching the names
+# of files included from system.h.  Exclude a couple.
+.re-list:
+       @sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
+         | grep -Ev 'sys/(param|file)\.h' \
+         | sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
+         > address@hidden
+       @mv address@hidden $@
 
 # Files in src/ should not include directly any of
 # the headers already included via system.h.
-# Get list of candidates with this:
-# grep -h include src/sys*.h|sed 's/.*include //'|sort -
-sc_system_h_headers:
-       @( cvsu --list ) > /dev/null 2>&1 || : &&                       \
-       grep -E '^# *include ["<]($(h_re))\.h[">]'                      \
-           $$(cvsu --list src | grep -Ev 'sys(2|tem)\.h$$')            \
-         && { echo '$(ME): the above are already included via system.h'\
-               1>&2; exit 1; } || :
+sc_system_h_headers: .re-list
+       if test -f $(srcdir)/src/system.h; then                 \
+         trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15;          \
+         grep -nE -f .re-list                                          \
+             $$($(CVS_LIST) src |                                      \
+                grep -Ev '((copy|system)\.h|parse-gram\.c)$$')         \
+           && { echo '$(ME): the above are already included via system.h'\
+                 1>&2;  exit 1; } || :;                                \
+       fi
 
 sc_sun_os_names:
-       @( cvsu --list ) > /dev/null 2>&1 || : && \
-       grep -Ei \
+       @grep -nEi \
            'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
-         $$(cvsu --list | grep -vEf .x-$@ ) &&                 \
+         $$($(CVS_LIST_EXCEPT)) &&                                     \
          { echo '$(ME): found misuse of Sun OS version numbers' 1>&2;  \
            exit 1; } || :
 
+sc_tight_scope:
+       $(MAKE) -C src $@
+
+sc_trailing_space:
+       @grep -n '[      ]$$'                                           \
+            $$($(CVS_LIST_EXCEPT)) &&                                  \
+         { echo '$(ME): found trailing space(s)'                       \
+               1>&2; exit 1; } || :
+
+# Look for diagnostics that aren't marked for translation.
+# This won't find any for which error's format string is on a separate line.
+sc_unmarked_diagnostics:
+       @grep -nE                                                       \
+           '\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c     \
+         | grep -v '_(' &&                                             \
+         { echo '$(ME): found unmarked diagnostic(s)' 1>&2;            \
+           exit 1; } || :
+
 # Ensure that date's --help output stays in sync with the info
 # documentation for GNU strftime.  The only exception is %N,
 # which date accepts but GNU strftime does not.
@@ -208,8 +281,17 @@ strftime-check:
 # not @...@ in Makefile.am, now that we can rely on automake
 # to emit a definition for each substituted variable.
 makefile-check:
-       grep -E '@[A-Z_0-9]+@' `find . -name Makefile.am` \
-         && { echo 'Makefile.maint: use $(...), not @...@' 1>&2; exit 1; } || :
+       grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
+         && { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || 
:
+
+news-date-check: NEWS
+       today=`date +%Y-%m-%d`; \
+       if head NEWS | grep '^\*.*'$$today >/dev/null; then \
+         :; \
+       else \
+         echo "today's date is not in NEWS" 1>&2; \
+         exit 1; \
+       fi
 
 changelog-check:
        if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
@@ -225,28 +307,30 @@ m4-check:
               exit 1; } || :
 
 # Verify that all source files using _() are listed in po/POTFILES.in.
+# FIXME: don't hard-code src/false.c below; use a more general mechanism.
 po-check:
-       if test -f po/POTFILES.in; then \
-         grep -E -v '^(#|$$)' po/POTFILES.in | sort > address@hidden; \
-         files=; \
+       if test -f po/POTFILES.in; then                                 \
+         grep -E -v '^(#|$$)' po/POTFILES.in                           \
+           | grep -v '^src/false\.c$$' | sort > address@hidden;                
        \
+         files=;                                                       \
          for file in lib/*.[chly] src/*.[chly]; do \
-           case $$file in \
-           *.[ch]) \
-             base=`expr " $$file" : ' \(.*\)\..'`; \
-             { test -f $$base.l || test -f $$base.y; } && continue;; \
-           esac; \
-           files="$$files $$file"; \
-         done; \
-         grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort > address@hidden; \
-         diff -u address@hidden address@hidden || exit 1; \
-         rm -f address@hidden address@hidden; \
+           case $$file in                                              \
+           *.[ch])                                                     \
+             base=`expr " $$file" : ' \(.*\)\..'`;                     \
+             { test -f $$base.l || test -f $$base.y; } && continue;;   \
+           esac;                                                       \
+           files="$$files $$file";                                     \
+         done;                                                         \
+         grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort > address@hidden;     
\
+         diff -u address@hidden address@hidden || exit 1;                      
                \
+         rm -f address@hidden address@hidden;                                  
        \
        fi
 
 # In a definition of #define AUTHORS "... and ..." where the RHS contains
 # the English word `and', the string must be marked with `N_ (...)' so that
 # gettext recognizes it as a string requiring translation.
 author_mark_check:
-       @grep '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
+       @grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
          { echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
            exit 1; } || :
 
@@ -258,7 +342,7 @@ author_mark_check:
 # that we'd have to worry about limits on command line length.
 msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
 makefile_path_separator_check:
-       @grep 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
+       @grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
          && { echo $(msg) 1>&2; exit 1; } || :
 
 # Check that `make alpha' will not fail at the end of the process.
@@ -279,7 +363,7 @@ v_etc_file = lib/version-etc.c
 # Make sure that the copyright date in $(v_etc_file) is up to date.
 copyright-check:
        @if test -f $(v_etc_file); then \
-         grep '"Copyright (C) $(shell date +%Y) Free' $(v_etc_file) \
+         grep 'enum { COPYRIGHT_YEAR = 2005 };' $(v_etc_file) \
            >/dev/null \
          || { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
               exit 1; }; \
@@ -330,21 +414,23 @@ null_AM_MAKEFLAGS = \
 # Detect format-string/arg-list mismatches that would normally be obscured
 # by the use of _().  The --disable-nls effectively defines away that macro,
 # and building with CFLAGS='-Wformat -Werror' causes any format warning to be
-# treated as a failure.
+# treated as a failure.  Also, check for shadowing problems with -Wshadow.
+# These CFLAGS are pretty strict.  If you build this target, you probably
+# have to have a recent version of gcc and glibc headers.
 TMPDIR ?= /tmp
 t=$(TMPDIR)/$(PACKAGE)/test
 my-distcheck: $(local-check)
        -rm -rf $(t)
        mkdir -p $(t)
        GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
-       cd $(t)/$(distdir) \
-         && ./configure --disable-nls \
-         && $(MAKE) CFLAGS='-Wformat -Werror' \
-             AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
-         && $(MAKE) dvi \
-         && $(MAKE) check \
+       cd $(t)/$(distdir)                              \
+         && ./configure --disable-nls                  \
+         && $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow' \
+             AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)'       \
+         && $(MAKE) dvi                                \
+         && $(MAKE) check                              \
          && $(MAKE) distclean
-       (cd $(t) && mv $(distdir) $(distdir).old \
+       (cd $(t) && mv $(distdir) $(distdir).old        \
          && $(AMTAR) -zxf - ) < $(distdir).tar.gz
        diff -ur $(t)/$(distdir).old $(t)/$(distdir)
        -rm -rf $(t)
@@ -377,15 +463,9 @@ rel-check:
 prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
 xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
 
-signatures ?= $(distdir).tar.bz2.asc $(distdir).tar.gz.asc
-%.asc: %
-       rm -f $@
-       gpg --armor --detach-sign -o $@ $<
-
-rel-files = $(xd-delta) $(distdir).tar.bz2 $(distdir).tar.gz $(signatures)
-announce_gen ?= ./announce-gen
-announcement: NEWS ChangeLog $(rel-files) $(signatures)
-       @$(announce_gen)                                                \
+rel-files = $(xd-delta) $(DIST_ARCHIVES)
+announcement: NEWS ChangeLog $(rel-files)
+       @./announce-gen                                                 \
            --release-type=$(RELEASE_TYPE)                              \
            --package=$(PACKAGE)                                        \
            --prev=$(PREV_VERSION)                                      \
@@ -395,25 +475,125 @@ announcement: NEWS ChangeLog $(rel-files
            $(addprefix --url-dir=, $(url_dir_list))                    \
 
 
-define emit-upload-commands
-       echo =====================================
-       echo =====================================
-       echo upload $(PACKAGE) $(PREV_VERSION) $(VERSION)
-       echo '# send the /tmp/announcement e-mail'
-       echo =====================================
-       echo =====================================
-endef
+## ---------------- ##
+## Updating files.  ##
+## ---------------- ##
+
+ftp-gnu = ftp://ftp.gnu.org/gnu
+www-gnu = http://www.gnu.org
+
+# Use mv, if you don't have/want move-if-change.
+move_if_change ?= move-if-change
+
+
+# --------------------- #
+# Updating everything.  #
+# --------------------- #
+
+.PHONY: update
+local_updates ?= wget-update cvs-update po-update
+update: $(local_updates)
+
+
+# ------------------- #
+# Updating PO files.  #
+# ------------------- #
+
+po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
+.PHONY: do-po-update po-update
+do-po-update:
+       tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
+       rm -rf $$tmppo && \
+       mkdir $$tmppo && \
+       (cd $$tmppo && \
+         $(WGET) $(WGETFLAGS) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
+       cp $$tmppo/*.po po
+       cd po && $(MAKE) update-po
+       $(MAKE) po-check
+
+po-update:
+       if test -d "po"; then \
+         $(MAKE) do-po-update; \
+       fi
+
+# -------------------------- #
+# Updating GNU build tools.  #
+# -------------------------- #
+
+# The following pseudo table associates a local directory and a URL
+# with each of the files that belongs to some other package and is
+# regularly updated from the specified URL.
+wget_files ?= \
+  $(srcdir)/build-aux/config.guess \
+  $(srcdir)/build-aux/config.sub \
+  $(srcdir)/build-aux/texinfo.tex \
+  $(srcdir)/src/ansi2knr.c
+
+get-targets = $(patsubst %, get-%, $(wget_files))
+
+config.guess-url_prefix = $(ftp-gnu)/build-aux/
+config.sub-url_prefix = $(ftp-gnu)/build-aux/
+
+ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
+
+texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
+
+standards.texi-url_prefix = $(www-gnu)/prep/
+make-stds.texi-url_prefix = $(standards.texi-url_prefix)
+
+target = $(patsubst get-%, %, $@)
+url = $($(notdir $(target))-url_prefix)$(notdir $(target))
+
+.PHONY: $(get-targets)
+$(get-targets):
+       $(WGET) $(WGETFLAGS) $(url) -O $(target).t \
+         && $(move_if_change) $(target).t $(target)
+
+cvs_files ?= \
+  $(srcdir)/build-aux/depcomp \
+  $(srcdir)/build-aux/install-sh \
+  $(srcdir)/build-aux/missing \
+  $(srcdir)/build-aux/mkinstalldirs \
+  $(srcdir)/src/ansi2knr.c
+automake_repo=:pserver:anoncvs:address@hidden:/cvs/automake
+.PHONY: wget-update
+wget-update: $(get-targets)
+
+.PHONY: cvs-update
+cvs-update:
+       fail=;                                                          \
+       for f in $(cvs_files); do                                       \
+         test -f $$f || { echo "*** skipping $$f" 1>&2; continue; };   \
+         cvs diff $$f > /dev/null                                      \
+           || { echo "*** $$f is locally modified; skipping it" 1>&2;  \
+                fail=yes; continue; };                                 \
+         file=$$(basename $$f);                                        \
+         echo checking out $$file...;                                  \
+         $(CVS) -d $(automake_repo) co -p automake/lib/$$file> $$f.t   \
+           && $(move_if_change) $$f.t $$f;                             \
+       done;                                                           \
+       test "$$fail" && exit 1
+
+emit_upload_commands:
+       @echo =====================================
+       @echo =====================================
+       @echo "$(srcdir)/gnupload $(GNUPLOADFLAGS) \\"
+       @echo "    --to $(gnu_rel_host):coreutils \\"
+       @echo "  $(rel-files)"
+       @echo '# send the /tmp/announcement e-mail'
+       @echo =====================================
+       @echo =====================================
 
 $(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
        xdelta delta -9 $^ $@ || :
 
 .PHONY: alpha beta major
-alpha beta major: $(local-check)
+alpha beta major: news-date-check $(local-check)
        $(MAKE) cvs-dist
        $(MAKE) $(xd-delta)
        $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
        ln $(rel-files) $(release_archive_dir)
        chmod a-w $(rel-files)
+       $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
        echo $(VERSION) > $(prev_version_file)
        $(CVS) ci -m. $(prev_version_file)
-       @$(emit-upload-commands)
Index: NEWS
===================================================================
RCS file: /cvsroot/bison/bison/NEWS,v
retrieving revision 1.120
diff -p -u -r1.120 NEWS
--- NEWS        19 Jul 2005 06:56:43 -0000      1.120
+++ NEWS        24 Jul 2005 07:20:54 -0000
@@ -1,7 +1,7 @@
 Bison News
 ----------
 
-Changes in the next version (not yet released):
+Changes in version 2.0b, 2005-07-24:
 
 * Bison-generated parsers now support the translation of diagnostics like
   "syntax error" into languages other than English.  The default
@@ -19,7 +19,10 @@ Changes in the next version (not yet rel
   behind on the stack.  Also, the start symbol is now destroyed after a
   successful parse.  In both cases, the behavior was formerly inconsistent.
 
-The following change was also in version 2.0a, 2005-05-22:
+* The yytname array now contains the same contents that it did in 2.0,
+  undoing an incompatible and undocumented change made in 2.0a.
+
+Changes in version 2.0a, 2005-05-22:
 
 * When generating verbose diagnostics, Bison-generated parsers no longer
   quote the literal strings associated with tokens.  For example, for
Index: data/c.m4
===================================================================
RCS file: /cvsroot/bison/bison/data/c.m4,v
retrieving revision 1.29
diff -p -u -r1.29 c.m4
--- data/c.m4   18 Jul 2005 22:14:15 -0000      1.29
+++ data/c.m4   24 Jul 2005 07:20:54 -0000
@@ -119,7 +119,7 @@ m4_define([b4_int_type],
 
        m4_eval([0 <= $1]),                [1], [unsigned int],
 
-                                              [int])])
+                                              [int])])
 
 
 # b4_int_type_for(NAME)
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.91
diff -p -u -r1.91 lalr1.cc
--- data/lalr1.cc       22 Jul 2005 17:07:31 -0000      1.91
+++ data/lalr1.cc       24 Jul 2005 07:20:54 -0000
@@ -946,7 +946,7 @@ yy::]b4_parser_class_name[::yyreport_syn
                   {
                     message += (!count++) ? ", expecting " : " or ";
                    message += yytnamerr_ (yytname_[x]);
-                 }
+                 }
             }
        }
       else
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.100
diff -p -u -r1.100 yacc.c
--- data/yacc.c 22 Jul 2005 17:07:31 -0000      1.100
+++ data/yacc.c 24 Jul 2005 07:20:55 -0000
@@ -82,7 +82,7 @@ m4_define([b4_int_type],
 
        m4_eval([0 <= $1]),                [1], [unsigned int],
 
-                                              [int])])
+                                              [int])])
 
 
 ## ----------------- ##
@@ -390,7 +390,7 @@ union yyalloc
 #define YYUNDEFTOK  ]b4_undef_token_number[
 #define YYMAXUTOK   ]b4_user_token_number_max[
 
-#define YYTRANSLATE(YYX)                                               \
+#define YYTRANSLATE(YYX)                                               \
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
@@ -529,7 +529,7 @@ do                                                          
\
       goto yybackup;                                           \
     }                                                          \
   else                                                         \
-    {                                                          \
+    {                                                          \
       yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \
       YYERROR;                                                 \
     }                                                          \
@@ -609,7 +609,7 @@ do {                                                        
        \
   if (yydebug)                                                 \
     {                                                          \
       YYFPRINTF (stderr, "%s ", Title);                                \
-      yysymprint (stderr,                                      \
+      yysymprint (stderr,                                      \
                   Type, Value]b4_location_if([, Location])[);  \
       YYFPRINTF (stderr, "\n");                                        \
     }                                                          \
Index: data/m4sugar/m4sugar.m4
===================================================================
RCS file: /cvsroot/bison/bison/data/m4sugar/m4sugar.m4,v
retrieving revision 1.7
diff -p -u -r1.7 m4sugar.m4
--- data/m4sugar/m4sugar.m4     14 May 2005 06:49:46 -0000      1.7
+++ data/m4sugar/m4sugar.m4     24 Jul 2005 07:20:55 -0000
@@ -2,7 +2,9 @@ divert(-1)#                             
 # This file is part of Autoconf.
 # Base M4 layer.
 # Requires GNU M4.
-# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+#
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+# Foundation, Inc.
 #
 # 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
@@ -58,7 +60,7 @@ changequote([, ])
 # long macros we define.
 ifdef([__gnu__], ,
 [errprint(M4sugar requires GNU M4. Install it before installing M4sugar or
-set the M4 environment variable to its path name.)
+set the M4 environment variable to its absolute file name.)
 m4exit(2)])
 
 
@@ -83,12 +85,12 @@ m4_undefine([undefine])
 # Define DST as the definition of SRC.
 # What's the difference between:
 # 1. m4_copy([from], [to])
-# 2. m4_define([from], [to($@)])
-# Well, obviously 1 is more expansive in space.  Maybe 2 is more expansive
+# 2. m4_define([to], [from($@)])
+# Well, obviously 1 is more expensive in space.  Maybe 2 is more expensive
 # in time, but because of the space cost of 1, it's not that obvious.
 # Nevertheless, one huge difference is the handling of `$0'.  If `from'
 # uses `$0', then with 1, `to''s `$0' is `to', while it is `from' in 2.
-# The user will certainly prefer see `from'.
+# The user will certainly prefer to see `to'.
 m4_define([m4_copy],
 [m4_define([$2], m4_defn([$1]))])
 
@@ -131,7 +133,7 @@ m4_rename_m4([eval])
 m4_rename_m4([format])
 m4_rename_m4([ifdef])
 m4_rename([ifelse], [m4_if])
-m4_rename_m4([include])
+m4_undefine([include])
 m4_rename_m4([incr])
 m4_rename_m4([index])
 m4_rename_m4([indir])
@@ -144,7 +146,7 @@ m4_undefine([popdef])
 m4_rename_m4([pushdef])
 m4_rename([regexp], [m4_bregexp])
 m4_rename_m4([shift])
-m4_rename_m4([sinclude])
+m4_undefine([sinclude])
 m4_rename_m4([substr])
 m4_rename_m4([symbols])
 m4_rename_m4([syscmd])
@@ -199,76 +201,29 @@ m4_define([m4_assert],
        [m4_fatal([assert failed: $1], [$2])])])
 
 
+
 ## ------------- ##
 ## 3. Warnings.  ##
 ## ------------- ##
 
 
-# m4_warning_ifelse(CATEGORY, IF-TRUE, IF-FALSE)
-# ----------------------------------------------
-# If the CATEGORY of warnings is enabled, expand IF_TRUE otherwise
-# IF-FALSE.
-#
-# The variable `m4_warnings' contains a comma separated list of
-# warnings which order is the converse from the one specified by
-# the user, i.e., if she specified `-W error,none,obsolete',
-# `m4_warnings' is `obsolete,none,error'.  We read it from left to
-# right, and:
-# - if none or noCATEGORY is met, run IF-FALSE
-# - if all or CATEGORY is met, run IF-TRUE
-# - if there is nothing left, run IF-FALSE.
-m4_define([m4_warning_ifelse],
-[_m4_warning_ifelse([$1], [$2], [$3], m4_warnings)])
-
-
-# _m4_warning_ifelse(CATEGORY, IF-TRUE, IF-FALSE, WARNING1, ...)
-# --------------------------------------------------------------
-# Implementation of the loop described above.
-m4_define([_m4_warning_ifelse],
-[m4_case([$4],
-         [$1],    [$2],
-         [all],   [$2],
-         [],      [$3],
-         [none],  [$3],
-         [no-$1], [$3],
-         [$0([$1], [$2], [$3], m4_shiftn(4, $@))])])
-
-
-# _m4_warning_error_ifelse(IF-TRUE, IF-FALSE)
-# -------------------------------------------
-# The same as m4_warning_ifelse, but scan for `error' only.
-m4_define([_m4_warning_error_ifelse],
-[__m4_warning_error_ifelse([$1], [$2], m4_warnings)])
-
-
-# __m4_warning_error_ifelse(IF-TRUE, IF-FALSE)
-# --------------------------------------------
-# The same as _m4_warning_ifelse, but scan for `error' only.
-m4_define([__m4_warning_error_ifelse],
-[m4_case([$3],
-         [error],    [$1],
-         [],         [$2],
-         [no-error], [$2],
-         [$0([$1], [$2], m4_shiftn(3, $@))])])
-
-
-
-# _m4_warn(MESSAGE)
-# -----------------
-# Report MESSAGE as a warning, unless the user requested -W error,
-# in which case report a fatal error.
-m4_define([_m4_warn],
-[_m4_warning_error_ifelse([m4_fatal([$1])],
-                          [m4_warning([$1])])])
+# _m4_warn(CATEGORY, MESSAGE, STACK-TRACE)
+# ----------------------------------------
+# Report a MESSAGE to the user if the CATEGORY of warnings is enabled.
+# This is for traces only.
+# The STACK-TRACE is a \n-separated list of "LOCATION: MESSAGE".
+m4_define([_m4_warn], [])
 
 
 # m4_warn(CATEGORY, MESSAGE)
 # --------------------------
-# Report a MESSAGE to the autoconf user if the CATEGORY of warnings
-# is requested (in fact, not disabled).
+# Report a MESSAGE to the user if the CATEGORY of warnings is enabled.
 m4_define([m4_warn],
-[m4_warning_ifelse([$1], [_m4_warn([$2])])])
-
+[_m4_warn([$1], [$2],
+m4_ifdef([m4_expansion_stack],
+         [m4_defn([m4_expansion_stack])
+m4_location[: the top level]]))dnl
+])
 
 
 
@@ -294,7 +249,7 @@ m4_define([m4_warn],
 # been included.
 m4_define([m4_include_unique],
 [m4_ifdef([m4_include($1)],
-          [m4_warn([syntax], [file `$1' included several times])])dnl
+         [m4_warn([syntax], [file `$1' included several times])])dnl
 m4_define([m4_include($1)])])
 
 
@@ -347,7 +302,7 @@ m4_define([m4_ifval],
 m4_define([m4_n],
 [m4_if([$1],
        [], [],
-           [$1
+          [$1
 ])])
 
 
@@ -358,7 +313,7 @@ m4_define([m4_n],
 m4_define([m4_ifvaln],
 [m4_if([$1],
        [],   [m4_n([$3])],
-             [m4_n([$2])])])
+            [m4_n([$2])])])
 
 
 # m4_ifset(MACRO, [IF-TRUE], [IF-FALSE])
@@ -367,8 +322,8 @@ m4_define([m4_ifvaln],
 # expand IF-FALSE, otherwise IF-TRUE.
 m4_define([m4_ifset],
 [m4_ifdef([$1],
-          [m4_if(m4_defn([$1]), [], [$3], [$2])],
-          [$3])])
+         [m4_ifval(m4_defn([$1]), [$2], [$3])],
+         [$3])])
 
 
 # m4_ifndef(NAME, [IF-NOT-DEFINED], [IF-DEFINED])
@@ -419,23 +374,32 @@ m4_define([m4_case],
 # All the values are optional, and the macro is robust to active symbols
 # properly quoted.
 m4_define([m4_bmatch],
-[m4_if([$#], 0, [],
-       [$#], 1, [],
+[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
+       [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
        [$#], 2, [$2],
        [m4_if(m4_bregexp([$1], [$2]), -1, [$0([$1], m4_shiftn(3, $@))],
              [$3])])])
 
 
+# m4_car(LIST)
+# m4_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+m4_define([m4_car], [[$1]])
+m4_define([m4_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+
+
 # m4_map(MACRO, LIST)
 # -------------------
 # Invoke MACRO($1), MACRO($2) etc. where $1, $2... are the elements
 # of LIST (which can be lists themselves, for multiple arguments MACROs).
 m4_define([m4_fst], [$1])
 m4_define([m4_map],
-[m4_if([$2], [], [],
-       [$2], [[]], [],
-       [$1(m4_fst($2))[]dnl
-m4_map([$1], m4_cdr($2))])])
+[m4_ifval([$2],
+         [$1(m4_fst($2))[]m4_map([$1], m4_cdr($2))])])
 
 
 # m4_map_sep(MACRO, SEPARATOR, LIST)
@@ -444,20 +408,16 @@ m4_map([$1], m4_cdr($2))])])
 # are the elements of LIST (which can be lists themselves, for multiple
 # arguments MACROs).
 m4_define([m4_map_sep],
-[m4_if([$3], [[]], [],
-       [$1(m4_fst($3))[]dnl
-m4_if(m4_cdr($3),
-      [[]], [],
-      [$2])[]dnl
-m4_map_sep([$1], [$2], m4_cdr($3))])])
+[m4_ifval([$3],
+         [$1(m4_fst($3))[]m4_map([$2[]$1], m4_cdr($3))])])
 
 
 ## ---------------------------------------- ##
 ## 6. Enhanced version of some primitives.  ##
 ## ---------------------------------------- ##
 
-# m4_patsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...)
-# ---------------------------------------------------
+# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...)
+# ----------------------------------------------------
 # m4 equivalent of
 #
 #   $_ = STRING;
@@ -468,7 +428,7 @@ m4_map_sep([$1], [$2], m4_cdr($3))])])
 # All the values are optional, and the macro is robust to active symbols
 # properly quoted.
 #
-# I would have liked to name this macro `m4_patsubst', unfortunately,
+# I would have liked to name this macro `m4_bpatsubst', unfortunately,
 # due to quotation problems, I need to double quote $1 below, therefore
 # the anchors are broken :(  I can't let users be trapped by that.
 m4_define([m4_bpatsubsts],
@@ -476,7 +436,7 @@ m4_define([m4_bpatsubsts],
        [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
        [$#], 2, [m4_builtin([patsubst], $@)],
        [$0(m4_builtin([patsubst], [[$1]], [$2], [$3]),
-           m4_shiftn(3, $@))])])
+          m4_shiftn(3, $@))])])
 
 
 
@@ -511,7 +471,7 @@ m4_define([m4_default],
 # undefined.
 m4_define([m4_defn],
 [m4_ifndef([$1],
-           [m4_fatal([$0: undefined macro: $1])])dnl
+          [m4_fatal([$0: undefined macro: $1])])dnl
 m4_builtin([defn], $@)])
 
 
@@ -519,7 +479,7 @@ m4_builtin([defn], $@)])
 # ---------------------
 m4_define([_m4_dumpdefs_up],
 [m4_ifdef([$1],
-          [m4_pushdef([_m4_dumpdefs], m4_defn([$1]))dnl
+         [m4_pushdef([_m4_dumpdefs], m4_defn([$1]))dnl
 m4_dumpdef([$1])dnl
 m4_popdef([$1])dnl
 _m4_dumpdefs_up([$1])])])
@@ -529,7 +489,7 @@ _m4_dumpdefs_up([$1])])])
 # -----------------------
 m4_define([_m4_dumpdefs_down],
 [m4_ifdef([_m4_dumpdefs],
-          [m4_pushdef([$1], m4_defn([_m4_dumpdefs]))dnl
+         [m4_pushdef([$1], m4_defn([_m4_dumpdefs]))dnl
 m4_popdef([_m4_dumpdefs])dnl
 _m4_dumpdefs_down([$1])])])
 
@@ -549,7 +509,7 @@ _m4_dumpdefs_down([$1])])
 # undefined.
 m4_define([m4_popdef],
 [m4_ifndef([$1],
-           [m4_fatal([$0: undefined macro: $1])])dnl
+          [m4_fatal([$0: undefined macro: $1])])dnl
 m4_builtin([popdef], $@)])
 
 
@@ -594,7 +554,7 @@ m4_define([_m4_shiftn],
 # undefined.
 m4_define([m4_undefine],
 [m4_ifndef([$1],
-           [m4_fatal([$0: undefined macro: $1])])dnl
+          [m4_fatal([$0: undefined macro: $1])])dnl
 m4_builtin([undefine], $@)])
 
 
@@ -609,8 +569,8 @@ m4_builtin([undefine], $@)])
 # Both limits are included, and bounds are checked for consistency.
 m4_define([m4_for],
 [m4_case(m4_sign(m4_eval($3 - $2)),
-         1, [m4_assert(m4_sign(m4_default($4, 1)) == 1)],
-        -1, [m4_assert(m4_sign(m4_default($4, -1)) == -1)])dnl
+        1, [m4_assert(m4_sign(m4_default($4, 1)) == 1)],
+       -1, [m4_assert(m4_sign(m4_default($4, -1)) == -1)])dnl
 m4_pushdef([$1], [$2])dnl
 m4_if(m4_eval([$3 > $2]), 1,
       [_m4_for([$1], [$3], m4_default([$4], 1), [$5])],
@@ -639,8 +599,8 @@ m4_if($1, [$2], [],
 # |        [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])])
 # | m4_define([_arg1], [$1])
 # | m4_define([_foreach],
-# |          [m4_if([$2], [()], ,
-# |                 [m4_define([$1], _arg1$2)$3[]_foreach([$1],
+# |           [m4_if([$2], [()], ,
+# |                 [m4_define([$1], _arg1$2)$3[]_foreach([$1],
 # |                                                        (shift$2),
 # |                                                        [$3])])])
 #
@@ -670,7 +630,7 @@ m4_if($1, [$2], [],
 # | m4_define([_arg1], [[$1]])
 # | m4_define([_foreach],
 # |  [m4_if($2, [()], ,
-# |        [m4_define([$1], [_arg1$2])$3[]_foreach([$1],
+# |         [m4_define([$1], [_arg1$2])$3[]_foreach([$1],
 # |                                                 [(shift$2)],
 # |                                                 [$3])])])
 #
@@ -695,7 +655,7 @@ m4_if($1, [$2], [],
 # | m4_define([_arg1], [$1])
 # | m4_define([_foreach],
 # |  [m4_if($2, [], ,
-# |        [m4_define([$1], [_arg1($2)])$3[]_foreach([$1],
+# |         [m4_define([$1], [_arg1($2)])$3[]_foreach([$1],
 # |                                                   [shift($2)],
 # |                                                   [$3])])])
 #
@@ -726,14 +686,25 @@ m4_if($1, [$2], [],
 m4_define([m4_foreach],
 [m4_pushdef([$1])_m4_foreach($@)m4_popdef([$1])])
 
-# Low level macros used to define m4_foreach.
-m4_define([m4_car], [[$1]])
-m4_define([m4_cdr], [m4_dquote(m4_shift($@))])
 m4_define([_m4_foreach],
-[m4_if([$2], [[]], [],
-       [m4_define([$1], m4_car($2))$3[]_m4_foreach([$1],
-                                                   m4_cdr($2),
-                                                   [$3])])])
+[m4_ifval([$2],
+         [m4_define([$1], m4_car($2))$3[]dnl
+_m4_foreach([$1], m4_cdr($2), [$3])])])
+
+
+# m4_foreach_w(VARIABLE, LIST, EXPRESSION)
+# ----------------------------------------
+#
+# Like m4_foreach, but the list is whitespace separated.
+#
+# This macro is robust to active symbols:
+#    m4_foreach_w([Var], [ active
+#    b act\
+#    ive  ], [-Var-])end
+#    => -active--b--active-end
+#
+m4_define([m4_foreach_w],
+[m4_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
 
 
 
@@ -745,23 +716,29 @@ m4_define([_m4_foreach],
 # _m4_divert(DIVERSION-NAME or NUMBER)
 # ------------------------------------
 # If DIVERSION-NAME is the name of a diversion, return its number,
-# otherwise if is a NUMBER return it.
+# otherwise if it is a NUMBER return it.
 m4_define([_m4_divert],
 [m4_ifdef([_m4_divert($1)],
-          [m4_indir([_m4_divert($1)])],
-          [$1])])
+         [m4_indir([_m4_divert($1)])],
+         [$1])])
 
 # KILL is only used to suppress output.
 m4_define([_m4_divert(KILL)],           -1)
 
 
+# _m4_divert_n_stack
+# ------------------
+# Print m4_divert_stack with newline prepended, if it's nonempty.
+m4_define([_m4_divert_n_stack],
+[m4_ifdef([m4_divert_stack], [
+m4_defn([m4_divert_stack])])])
+
+
 # m4_divert(DIVERSION-NAME)
 # -------------------------
 # Change the diversion stream to DIVERSION-NAME.
 m4_define([m4_divert],
-[m4_define([m4_divert_stack],
-           m4_location[: $0: $1]m4_ifdef([m4_divert_stack], [
-m4_defn([m4_divert_stack])]))dnl
+[m4_define([m4_divert_stack], m4_location[: $0: $1]_m4_divert_n_stack)dnl
 m4_builtin([divert], _m4_divert([$1]))dnl
 ])
 
@@ -770,11 +747,9 @@ m4_builtin([divert], _m4_divert([$1]))dn
 # ------------------------------
 # Change the diversion stream to DIVERSION-NAME, while stacking old values.
 m4_define([m4_divert_push],
-[m4_pushdef([m4_divert_stack],
-            m4_location[: $0: $1]m4_ifdef([m4_divert_stack], [
-m4_defn([m4_divert_stack])]))dnl
+[m4_pushdef([m4_divert_stack], m4_location[: $0: $1]_m4_divert_n_stack)dnl
 m4_pushdef([_m4_divert_diversion], [$1])dnl
-m4_builtin([divert], _m4_divert(_m4_divert_diversion))dnl
+m4_builtin([divert], _m4_divert([$1]))dnl
 ])
 
 
@@ -782,18 +757,19 @@ m4_builtin([divert], _m4_divert(_m4_dive
 # -------------------------------
 # Change the diversion stream to its previous value, unstacking it.
 # If specified, verify we left DIVERSION-NAME.
+# When we pop the last value from the stack, we divert to -1.
 m4_define([m4_divert_pop],
-[m4_ifval([$1],
-     [m4_if(_m4_divert([$1]), m4_divnum, [],
-            [m4_fatal([$0($1): diversion mismatch: ]
-m4_defn([m4_divert_stack]))])])dnl
+[m4_ifndef([_m4_divert_diversion],
+           [m4_fatal([too many m4_divert_pop])])dnl
+m4_if([$1], [], [],
+      [$1], m4_defn([_m4_divert_diversion]), [],
+      [m4_fatal([$0($1): diversion mismatch: ]_m4_divert_n_stack)])dnl
+m4_popdef([m4_divert_stack])dnl
 m4_popdef([_m4_divert_diversion])dnl
-dnl m4_ifndef([_m4_divert_diversion],
-dnl           [m4_fatal([too many m4_divert_pop])])dnl
 m4_builtin([divert],
-           m4_ifdef([_m4_divert_diversion],
-                    [_m4_divert(_m4_divert_diversion)], -1))dnl
-m4_popdef([m4_divert_stack])dnl
+          m4_ifdef([_m4_divert_diversion],
+                   [_m4_divert(m4_defn([_m4_divert_diversion]))],
+                   -1))dnl
 ])
 
 
@@ -866,18 +842,18 @@ m4_define([m4_undivert],
 # must keep the expansions of the various level of m4_require separated.
 # Right before executing the epilogue of TEST1, we have:
 #
-#         GROW - 2: Test...3
-#         GROW - 1: Test...2
-#         GROW:     Test...1
-#         BODY:
+#         GROW - 2: Test...3
+#         GROW - 1: Test...2
+#         GROW:     Test...1
+#         BODY:
 #
 # Finally the epilogue of TEST1 undiverts GROW - 2, GROW - 1, and
 # GROW into the regular flow, BODY.
 #
-#         GROW - 2:
-#         GROW - 1:
-#         GROW:
-#         BODY:        Test...3; Test...2; Test...1
+#         GROW - 2:
+#         GROW - 1:
+#         GROW:
+#         BODY:        Test...3; Test...2; Test...1
 #
 # (The semicolons are here for clarification, but of course are not
 # emitted.)  This is what Autoconf 2.0 (I think) to 2.13 (I'm sure)
@@ -901,27 +877,27 @@ m4_define([m4_undivert],
 #
 # The dependencies between the macros are:
 #
-#               3 --- 2b
-#              /        \              is m4_require'd by
-#             /          \       left -------------------- right
-#          2a ------------ 1
+#               3 --- 2b
+#              /        \              is m4_require'd by
+#             /          \       left -------------------- right
+#          2a ------------ 1
 #
 # If you strictly apply the rules given in the previous section you get:
 #
-#         GROW - 2: TEST3
-#         GROW - 1: TEST2a; TEST2b
-#         GROW:     TEST1
-#         BODY:
+#         GROW - 2: TEST3
+#         GROW - 1: TEST2a; TEST2b
+#         GROW:     TEST1
+#         BODY:
 #
 # (TEST2a, although required by TEST3 is not expanded in GROW - 3
 # because is has already been expanded before in GROW - 1, so it has
 # been AC_PROVIDE'd, so it is not expanded again) so when you undivert
 # the stack of diversions, you get:
 #
-#         GROW - 2:
-#         GROW - 1:
-#         GROW:
-#         BODY:        TEST3; TEST2a; TEST2b; TEST1
+#         GROW - 2:
+#         GROW - 1:
+#         GROW:
+#         BODY:        TEST3; TEST2a; TEST2b; TEST1
 #
 # i.e., TEST2a is expanded after TEST3 although the latter required the
 # former.
@@ -939,48 +915,48 @@ m4_define([m4_undivert],
 # In the example above, when TEST2a is expanded, but it's epilogue is
 # not run yet, you have:
 #
-#         GROW - 2:
-#         GROW - 1: TEST2a
-#         GROW:     Elaboration of TEST1
-#         BODY:
+#         GROW - 2:
+#         GROW - 1: TEST2a
+#         GROW:     Elaboration of TEST1
+#         BODY:
 #
 # The epilogue of TEST2a emits it immediately:
 #
-#         GROW - 2:
-#         GROW - 1:
-#         GROW:     Elaboration of TEST1
-#         BODY:     TEST2a
+#         GROW - 2:
+#         GROW - 1:
+#         GROW:     Elaboration of TEST1
+#         BODY:     TEST2a
 #
 # TEST2b then requires TEST3, so right before the epilogue of TEST3, you
 # have:
 #
-#         GROW - 2: TEST3
-#         GROW - 1: Elaboration of TEST2b
-#         GROW:     Elaboration of TEST1
-#         BODY:      TEST2a
+#         GROW - 2: TEST3
+#         GROW - 1: Elaboration of TEST2b
+#         GROW:     Elaboration of TEST1
+#         BODY:      TEST2a
 #
 # The epilogue of TEST3 emits it:
 #
-#         GROW - 2:
-#         GROW - 1: Elaboration of TEST2b
-#         GROW:     Elaboration of TEST1
-#         BODY:     TEST2a; TEST3
+#         GROW - 2:
+#         GROW - 1: Elaboration of TEST2b
+#         GROW:     Elaboration of TEST1
+#         BODY:     TEST2a; TEST3
 #
 # TEST2b is now completely expanded, and emitted:
 #
-#         GROW - 2:
-#         GROW - 1:
-#         GROW:     Elaboration of TEST1
-#         BODY:     TEST2a; TEST3; TEST2b
+#         GROW - 2:
+#         GROW - 1:
+#         GROW:     Elaboration of TEST1
+#         BODY:     TEST2a; TEST3; TEST2b
 #
 # and finally, TEST1 is finished and emitted:
 #
-#         GROW - 2:
-#         GROW - 1:
-#         GROW:
-#         BODY:     TEST2a; TEST3; TEST2b: TEST1
+#         GROW - 2:
+#         GROW - 1:
+#         GROW:
+#         BODY:     TEST2a; TEST3; TEST2b: TEST1
 #
-# The idea, is simple, but the implementation is a bit evolved.  If you
+# The idea is simple, but the implementation is a bit evolved.  If you
 # are like me, you will want to see the actual functioning of this
 # implementation to be convinced.  The next section gives the full
 # details.
@@ -991,18 +967,18 @@ m4_define([m4_undivert],
 #
 # We consider the macros above, and this configure.ac:
 #
-#          AC_INIT
-#          TEST1
+#          AC_INIT
+#          TEST1
 #
 # You should keep the definitions of _m4_defun_pro, _m4_defun_epi, and
 # m4_require at hand to follow the steps.
 #
-# This implements tries not to assume that of the current diversion is
+# This implements tries not to assume that the current diversion is
 # BODY, so as soon as a macro (m4_defun'd) is expanded, we first
 # record the current diversion under the name _m4_divert_dump (denoted
 # DUMP below for short).  This introduces an important difference with
 # the previous versions of Autoconf: you cannot use m4_require if you
-# were not inside an m4_defun'd macro, and especially, you cannot
+# are not inside an m4_defun'd macro, and especially, you cannot
 # m4_require directly from the top level.
 #
 # We have not tried to simulate the old behavior (better yet, we
@@ -1017,104 +993,64 @@ m4_define([m4_undivert],
 #   diversion stack:     BODY |-
 #
 # * TEST1 is expanded
-# The prologue of TEST1 sets AC_DIVERSION_DUMP, which is the diversion
+# The prologue of TEST1 sets _m4_divert_dump, which is the diversion
 # where the current elaboration will be dumped, to the current
 # diversion.  It also m4_divert_push to GROW, where the full
 # expansion of TEST1 and its dependencies will be elaborated.
-#   DUMP:       BODY
-#   BODY:       empty
-#   diversions: GROW, BODY |-
-#
-# * TEST1 requires TEST2a: prologue
-# m4_require m4_divert_pushes another temporary diversion GROW - 1 (in
-# fact, the diversion whose number is one less than the current
-# diversion), and expands TEST2a in there.
-#   DUMP:       BODY
-#   BODY:       empty
-#   diversions: GROW-1, GROW, BODY |-
-#
-# * TEST2a is expanded.
-# Its prologue pushes the current diversion again.
-#   DUMP:       BODY
-#   BODY:       empty
-#   diversions: GROW - 1, GROW - 1, GROW, BODY |-
-# It is expanded in GROW - 1, and GROW - 1 is popped by the epilogue
-# of TEST2a.
 #   DUMP:        BODY
-#   BODY:        nothing
+#   BODY:        empty
+#   diversions:  GROW, BODY |-
+#
+# * TEST1 requires TEST2a
+# _m4_require_call m4_divert_pushes another temporary diversion,
+# GROW - 1, and expands TEST2a in there.
+#   DUMP:        BODY
+#   BODY:        empty
 #   GROW - 1:    TEST2a
 #   diversions:  GROW - 1, GROW, BODY |-
+# Than the content of the temporary diversion is moved to DUMP and the
+# temporary diversion is popped.
+#   DUMP:        BODY
+#   BODY:        TEST2a
+#   diversions:  GROW, BODY |-
+#
+# * TEST1 requires TEST2b
+# Again, _m4_require_call pushes GROW - 1 and heads to expand TEST2b.
+#   DUMP:        BODY
+#   BODY:        TEST2a
+#   diversions:  GROW - 1, GROW, BODY |-
+#
+# * TEST2b requires TEST3
+# _m4_require_call pushes GROW - 2 and expands TEST3 here.
+# (TEST3 requires TEST2a, but TEST2a has already been m4_provide'd, so
+# nothing happens.)
+#   DUMP:        BODY
+#   BODY:        TEST2a
+#   GROW - 2:    TEST3
+#   diversions:  GROW - 2, GROW - 1, GROW, BODY |-
+# Than the diversion is appended to DUMP, and popped.
+#   DUMP:        BODY
+#   BODY:        TEST2a; TEST3
+#   diversions:  GROW - 1, GROW, BODY |-
 #
-# * TEST1 requires TEST2a: epilogue
-# The content of the current diversion is appended to DUMP (and removed
-# from the current diversion).  A diversion is popped.
-#   DUMP:       BODY
-#   BODY:       TEST2a
-#   diversions: GROW, BODY |-
-#
-# * TEST1 requires TEST2b: prologue
-# m4_require pushes GROW - 1 and expands TEST2b.
-#   DUMP:       BODY
-#   BODY:       TEST2a
-#   diversions: GROW - 1, GROW, BODY |-
-#
-# * TEST2b is expanded.
-# Its prologue pushes the current diversion again.
-#   DUMP:       BODY
-#   BODY:       TEST2a
-#   diversions: GROW - 1, GROW - 1, GROW, BODY |-
-# The body is expanded here.
-#
-# * TEST2b requires TEST3: prologue
-# m4_require pushes GROW - 2 and expands TEST3.
-#   DUMP:       BODY
-#   BODY:       TEST2a
-#   diversions: GROW - 2, GROW - 1, GROW - 1, GROW, BODY |-
-#
-# * TEST3 is expanded.
-# Its prologue pushes the current diversion again.
-#   DUMP:       BODY
-#   BODY:       TEST2a
-#   diversions: GROW-2, GROW-2, GROW-1, GROW-1, GROW, BODY |-
-# TEST3 requires TEST2a, but TEST2a has already been AC_PROVIDE'd, so
-# nothing happens.  It's body is expanded here, and its epilogue pops a
-# diversion.
-#   DUMP:       BODY
-#   BODY:       TEST2a
-#   GROW - 2:   TEST3
-#   diversions: GROW - 2, GROW - 1, GROW - 1, GROW, BODY |-
-#
-# * TEST2b requires TEST3: epilogue
-# The current diversion is appended to DUMP, and a diversion is popped.
-#   DUMP:       BODY
-#   BODY:       TEST2a; TEST3
-#   diversions: GROW - 1, GROW - 1, GROW, BODY |-
-# The content of TEST2b is expanded here.
-#   DUMP:       BODY
-#   BODY:       TEST2a; TEST3
-#   GROW - 1:   TEST2b,
-#   diversions: GROW - 1, GROW - 1, GROW, BODY |-
-# The epilogue of TEST2b pops a diversion.
-#   DUMP:       BODY
-#   BODY:       TEST2a; TEST3
-#   GROW - 1:   TEST2b,
-#   diversions: GROW - 1, GROW, BODY |-
-#
-# * TEST1 requires TEST2b: epilogue
-# The current diversion is appended to DUMP, and a diversion is popped.
-#   DUMP:       BODY
-#   BODY:       TEST2a; TEST3; TEST2b
-#   diversions: GROW, BODY |-
+# * TEST1 requires TEST2b (contd.)
+# The content of TEST2b is expanded...
+#   DUMP:        BODY
+#   BODY:        TEST2a; TEST3
+#   GROW - 1:    TEST2b,
+#   diversions:  GROW - 1, GROW, BODY |-
+# ... and moved to DUMP.
+#   DUMP:        BODY
+#   BODY:        TEST2a; TEST3; TEST2b
+#   diversions:  GROW, BODY |-
 #
 # * TEST1 is expanded: epilogue
-# TEST1's own content is in GROW, and it's epilogue pops a diversion.
-#   DUMP:       BODY
-#   BODY:       TEST2a; TEST3; TEST2b
-#   GROW:       TEST1
-#   diversions: BODY |-
-# Here, the epilogue of TEST1 notices the elaboration is done because
-# DUMP and the current diversion are the same, it then undiverts
-# GROW by hand, and undefines DUMP.
+# TEST1's own content is in GROW...
+#   DUMP:        BODY
+#   BODY:        TEST2a; TEST3; TEST2b
+#   GROW:        TEST1
+#   diversions:  BODY |-
+# ... and it's epilogue moves it to DUMP and then undefines DUMP.
 #   DUMP:       undefined
 #   BODY:       TEST2a; TEST3; TEST2b; TEST1
 #   diversions: BODY |-
@@ -1136,37 +1072,21 @@ m4_define([m4_undivert],
 # we prepend its name in m4_expansion_stack, and when we exit the
 # macro, we remove it (thanks to pushdef/popdef).
 #
-# In addition, we want to use the expansion stack to detect circular
-# m4_require dependencies.  This means we need to browse the stack to
-# check whether a macro being expanded is m4_require'd.  For ease of
-# implementation, and certainly for the benefit of performances, we
-# don't browse the m4_expansion_stack, rather each time we expand a
-# macro FOO we define _m4_expanding(FOO).  Then m4_require(BAR) simply
-# needs to check whether _m4_expanding(BAR) is defined to diagnose a
-# circular dependency.
-#
-# To improve the diagnostic, in addition to keeping track of the stack
-# of macro calls, m4_expansion_stack also records the m4_require
-# stack.  Note that therefore an m4_defun'd macro being required will
-# appear twice in the stack: the first time because it is required,
-# the second because it is expanded.  We can avoid this, but it has
-# two small drawbacks: (i) the implementation is slightly more
-# complex, and (ii) it hides the difference between define'd macros
-# (which don't appear in m4_expansion_stack) and m4_defun'd macros
-# (which do).  The more debugging information, the better.
+# In addition, we want to detect circular m4_require dependencies.
+# Each time we expand a macro FOO we define _m4_expanding(FOO); and
+# m4_require(BAR) simply checks whether _m4_expanding(BAR) is defined.
 
 
 # m4_expansion_stack_push(TEXT)
 # -----------------------------
 m4_define([m4_expansion_stack_push],
 [m4_pushdef([m4_expansion_stack],
-            [$1]m4_ifdef([m4_expansion_stack], [
+           [$1]m4_ifdef([m4_expansion_stack], [
 m4_defn([m4_expansion_stack])]))])
 
 
 # m4_expansion_stack_pop
 # ----------------------
-# Dump the expansion stack.
 m4_define([m4_expansion_stack_pop],
 [m4_popdef([m4_expansion_stack])])
 
@@ -1176,7 +1096,7 @@ m4_define([m4_expansion_stack_pop],
 # Dump the expansion stack.
 m4_define([m4_expansion_stack_dump],
 [m4_ifdef([m4_expansion_stack],
-          [m4_errprintn(m4_defn([m4_expansion_stack]))])dnl
+         [m4_errprintn(m4_defn([m4_expansion_stack]))])dnl
 m4_errprintn(m4_location[: the top level])])
 
 
@@ -1203,29 +1123,33 @@ m4_define([_m4_divert(GROW)],       1000
 # -------------------------
 # The prologue for Autoconf macros.
 m4_define([_m4_defun_pro],
-[m4_expansion_stack_push(m4_defn([m4_location($1)])[: $1 is expanded 
from...])dnl
+[m4_ifndef([m4_expansion_stack], [_m4_defun_pro_outer[]])dnl
+m4_expansion_stack_push(m4_defn([m4_location($1)])[: $1 is expanded 
from...])dnl
 m4_pushdef([_m4_expanding($1)])dnl
-m4_ifdef([_m4_divert_dump],
-         [m4_divert_push(m4_defn([_m4_divert_diversion]))],
-         [m4_copy([_m4_divert_diversion], [_m4_divert_dump])dnl
-m4_divert_push([GROW])])dnl
 ])
 
+m4_define([_m4_defun_pro_outer],
+[m4_copy([_m4_divert_diversion], [_m4_divert_dump])dnl
+m4_divert_push([GROW])dnl
+])
 
 # _m4_defun_epi(MACRO-NAME)
 # -------------------------
 # The Epilogue for Autoconf macros.  MACRO-NAME only helps tracing
 # the PRO/EPI pairs.
 m4_define([_m4_defun_epi],
-[m4_divert_pop()dnl
-m4_if(_m4_divert_dump, _m4_divert_diversion,
-      [m4_undivert([GROW])dnl
-m4_undefine([_m4_divert_dump])])dnl
+[m4_popdef([_m4_expanding($1)])dnl
 m4_expansion_stack_pop()dnl
-m4_popdef([_m4_expanding($1)])dnl
+m4_ifndef([m4_expansion_stack], [_m4_defun_epi_outer[]])dnl
 m4_provide([$1])dnl
 ])
 
+m4_define([_m4_defun_epi_outer],
+[m4_undefine([_m4_divert_dump])dnl
+m4_divert_pop([GROW])dnl
+m4_undivert([GROW])dnl
+])
+
 
 # m4_defun(NAME, EXPANSION)
 # -------------------------
@@ -1240,7 +1164,7 @@ m4_provide([$1])dnl
 m4_define([m4_defun],
 [m4_define([m4_location($1)], m4_location)dnl
 m4_define([$1],
-          [_m4_defun_pro([$1])$2[]_m4_defun_epi([$1])])])
+         [_m4_defun_pro([$1])$2[]_m4_defun_epi([$1])])])
 
 
 # m4_defun_once(NAME, EXPANSION)
@@ -1250,9 +1174,9 @@ m4_define([$1],
 m4_define([m4_defun_once],
 [m4_define([m4_location($1)], m4_location)dnl
 m4_define([$1],
-          [m4_provide_if([$1],
-                         [m4_warn([syntax], [$1 invoked multiple times])],
-                         [_m4_defun_pro([$1])$2[]_m4_defun_epi([$1])])])])
+         [m4_provide_if([$1],
+                        [m4_warn([syntax], [$1 invoked multiple times])],
+                        [_m4_defun_pro([$1])$2[]_m4_defun_epi([$1])])])])
 
 
 # m4_pattern_forbid(ERE, [WHY])
@@ -1278,7 +1202,7 @@ m4_define([m4_pattern_allow], [])
 # ---------------------------------------------
 m4_define([m4_before],
 [m4_provide_if([$2],
-               [m4_warn([syntax], [$2 was called before $1])])])
+              [m4_warn([syntax], [$2 was called before $1])])])
 
 
 # m4_require(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK])
@@ -1314,34 +1238,48 @@ m4_define([m4_before],
 #   `extension' prevents `AC_LANG_COMPILER' from having actual arguments that
 #   it passes to `AC_LANG_COMPILER(C)'.
 m4_define([m4_require],
-[m4_expansion_stack_push(m4_location[: $1 is required by...])dnl
-m4_ifdef([_m4_expanding($1)],
-         [m4_fatal([$0: circular dependency of $1])])dnl
+[m4_ifdef([_m4_expanding($1)],
+        [m4_fatal([$0: circular dependency of $1])])dnl
 m4_ifndef([_m4_divert_dump],
-          [m4_fatal([$0: cannot be used outside of an m4_defun'd macro])])dnl
+         [m4_fatal([$0($1): cannot be used outside of an m4_defun'd 
macro])])dnl
 m4_provide_if([$1],
-              [],
-              [m4_divert_push(m4_eval(m4_divnum - 1))dnl
+             [],
+             [_m4_require_call([$1], [$2])])dnl
+])
+
+
+# _m4_require_call(BODY-TO-EXPAND)
+# --------------------------------
+# If m4_require decides to expand the body, it calls this macro.
+m4_define([_m4_require_call],
+[m4_define([_m4_divert_grow], m4_decr(_m4_divert_grow))dnl
+m4_divert_push(_m4_divert_grow)dnl
 m4_default([$2], [$1])
-m4_divert(m4_defn([_m4_divert_dump]))dnl
-m4_undivert(m4_defn([_m4_divert_diversion]))dnl
-m4_divert_pop(m4_defn([_m4_divert_dump]))])dnl
 m4_provide_if([$1],
-              [],
-              [m4_warn([syntax],
-                       [$1 is m4_require'd but is not m4_defun'd])])dnl
-m4_expansion_stack_pop()dnl
+             [],
+             [m4_warn([syntax],
+                      [$1 is m4_require'd but not m4_defun'd])])dnl
+m4_divert(m4_defn([_m4_divert_dump]))dnl
+m4_undivert(_m4_divert_grow)dnl
+m4_divert_pop(_m4_divert_grow)dnl
+m4_define([_m4_divert_grow], m4_incr(_m4_divert_grow))dnl
 ])
 
 
+# _m4_divert_grow
+# ---------------
+# The counter for _m4_require_call.
+m4_define([_m4_divert_grow], _m4_divert([GROW]))
+
+
 # m4_expand_once(TEXT, [WITNESS = TEXT])
 # --------------------------------------
 # If TEXT has never been expanded, expand it *here*.  Use WITNESS as
 # as a memory that TEXT has already been expanded.
 m4_define([m4_expand_once],
 [m4_provide_if(m4_ifval([$2], [[$2]], [[$1]]),
-               [],
-               [m4_provide(m4_ifval([$2], [[$2]], [[$1]]))[]$1])])
+              [],
+              [m4_provide(m4_ifval([$2], [[$2]], [[$1]]))[]$1])])
 
 
 # m4_provide(MACRO-NAME)
@@ -1358,7 +1296,7 @@ m4_define([m4_provide],
 # information is coded.
 m4_define([m4_provide_if],
 [m4_ifdef([m4_provide($1)],
-          [$2], [$3])])
+         [$2], [$3])])
 
 
 ## -------------------- ##
@@ -1397,17 +1335,18 @@ m4_defn([m4_cr_digits])dnl
 
 # m4_re_escape(STRING)
 # --------------------
-# Escape BRE active characters in STRING.
+# Escape RE active characters in STRING.
 m4_define([m4_re_escape],
 [m4_bpatsubst([$1],
-              [[][+*.]], [\\\&])])
+             [[][*+.?\^$]], [\\\&])])
 
 
 # m4_re_string
 # ------------
 # Regexp for `[a-zA-Z_0-9]*'
+# m4_dquote provides literal [] for the character class.
 m4_define([m4_re_string],
-m4_defn([m4_cr_symbols2])dnl
+m4_dquote(m4_defn([m4_cr_symbols2]))dnl
 [*]dnl
 )
 
@@ -1416,7 +1355,7 @@ m4_defn([m4_cr_symbols2])dnl
 # ----------
 # Regexp for `[a-zA-Z_][a-zA-Z_0-9]*'
 m4_define([m4_re_word],
-m4_defn([m4_cr_symbols1])dnl
+m4_dquote(m4_defn([m4_cr_symbols1]))dnl
 m4_defn([m4_re_string])dnl
 )
 
@@ -1440,11 +1379,11 @@ m4_define([m4_toupper],
 #
 # REGEXP specifies where to split.  Default is [\t ]+.
 #
-# Pay attention to the m4_changequotes.  Inner m4_changequotes exist for
-# obvious reasons (we want to insert square brackets).  Outer
-# m4_changequotes are needed because otherwise the m4 parser, when it
-# sees the closing bracket we add to the result, believes it is the
-# end of the body of the macro we define.
+# If STRING is empty, the result is an empty list.
+#
+# Pay attention to the m4_changequotes.  When m4 reads the definition of
+# m4_split, it still has quotes set to [ and ].  Luckily, these are matched
+# in the macro body, so the definition is stored correctly.
 #
 # Also, notice that $1 is quoted twice, since we want the result to
 # be quoted.  Then you should understand that the argument of
@@ -1455,16 +1394,17 @@ m4_define([m4_toupper],
 #   m4_split([active active ])end
 #   => [active], [active], []end
 
-m4_changequote(<<, >>)
-m4_define(<<m4_split>>,
-<<m4_changequote(``, '')dnl
+m4_define([m4_split],
+[m4_ifval([$1], [_m4_split($@)])])
+
+m4_define([_m4_split],
+[m4_changequote(``, '')dnl
 [dnl Can't use m4_default here instead of m4_if, because m4_default uses
 dnl [ and ] as quotes.
 m4_bpatsubst(````$1'''',
-            m4_if(``$2'',, ``[         ]+'', ``$2''),
+            m4_if(``$2'',, ``[  ]+'', ``$2''),
             ``], ['')]dnl
-m4_changequote([, ])>>)
-m4_changequote([, ])
+m4_changequote([, ])])
 
 
 
@@ -1491,13 +1431,10 @@ m4_define([m4_flatten],
 #
 # This macro is robust to active symbols.
 #    m4_define(active, ACTIVE)
-#    m4_strip([  active                active ])end
+#    m4_strip([  active <tab> <tab>active ])end
 #    => active activeend
 #
-# This macro is fun!  Because we want to preserve active symbols, STRING
-# must be quoted for each evaluation, which explains there are 4 levels
-# of brackets around $1 (don't forget that the result must be quoted
-# too, hence one more quoting than applications).
+# Because we want to preserve active symbols, STRING must be double-quoted.
 #
 # Then notice the 2 last patterns: they are in charge of removing the
 # leading/trailing spaces.  Why not just `[^ ]'?  Because they are
@@ -1506,9 +1443,9 @@ m4_define([m4_flatten],
 # character, since there are two leading `['; equally for the last pattern.
 m4_define([m4_strip],
 [m4_bpatsubsts([[$1]],
-               [[      ]+], [ ],
-               [^\(..\) ],    [\1],
-               [ \(..\)$],    [\1])])
+              [[        ]+], [ ],
+              [^\(..\) ],    [\1],
+              [ \(..\)$],    [\1])])
 
 
 # m4_normalize(STRING)
@@ -1533,9 +1470,9 @@ m4_define([m4_normalize],
 # Produce ARG1SEPARG2...SEPARGn.
 m4_defun([m4_join],
 [m4_case([$#],
-         [1], [],
-         [2], [[$2]],
-         [[$2][$1]$0([$1], m4_shiftn(2, $@))])])
+        [1], [],
+        [2], [[$2]],
+        [[$2][$1]$0([$1], m4_shiftn(2, $@))])])
 
 
 
@@ -1573,7 +1510,7 @@ m4_defun([m4_join],
 #    => active
 m4_define([m4_append],
 [m4_define([$1],
-           m4_ifdef([$1], [m4_defn([$1])$3])[$2])])
+          m4_ifdef([$1], [m4_defn([$1])$3])[$2])])
 
 
 # m4_append_uniq(MACRO-NAME, STRING, [SEPARATOR])
@@ -1581,18 +1518,18 @@ m4_define([m4_append],
 # As `m4_append', but append only if not yet present.
 m4_define([m4_append_uniq],
 [m4_ifdef([$1],
-          [m4_bmatch([$3]m4_defn([$1])[$3], m4_re_escape([$3$2$3]), [],
-                     [m4_append($@)])],
-          [m4_append($@)])])
+         [m4_bmatch([$3]m4_defn([$1])[$3], m4_re_escape([$3$2$3]), [],
+                    [m4_append($@)])],
+         [m4_append($@)])])
 
 
 # m4_text_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH])
 # -------------------------------------------------------
 # Expands into STRING wrapped to hold in WIDTH columns (default = 79).
-# If prefix is set, each line is prefixed with it.  If FIRST-PREFIX is
-# specified, then the first line is prefixed with it.  As a special
-# case, if the length of the first prefix is greater than that of
-# PREFIX, then FIRST-PREFIX will be left alone on the first line.
+# If PREFIX is given, each line is prefixed with it.  If FIRST-PREFIX is
+# specified, then the first line is prefixed with it.  As a special case,
+# if the length of FIRST-PREFIX is greater than that of PREFIX, then
+# FIRST-PREFIX will be left alone on the first line.
 #
 # Typical outputs are:
 #
@@ -1612,19 +1549,22 @@ m4_define([m4_append_uniq],
 #
 # m4_text_wrap([Super long documentation.], [          ], [  --too-wide ], 30)
 #  =>   --too-wide
-#  =>    Super long
-#  =>    documentation.
+#  =>      Super long
+#  =>      documentation.
 #
 # FIXME: there is no checking of a longer PREFIX than WIDTH, but do
 # we really want to bother with people trying each single corner
 # of a software?
 #
+# more important:
+# FIXME: handle quadrigraphs correctly, both in TEXT and in FIRST_PREFIX.
+#
 # This macro does not leave a trailing space behind the last word,
 # what complicates it a bit.  The algorithm is stupid simple: all the
 # words are preceded by m4_Separator which is defined to empty for the
 # first word, and then ` ' (single space) for all the others.
 m4_define([m4_text_wrap],
-[m4_pushdef([m4_Prefix], m4_default([$2], []))dnl
+[m4_pushdef([m4_Prefix], [$2])dnl
 m4_pushdef([m4_Prefix1], m4_default([$3], [m4_Prefix]))dnl
 m4_pushdef([m4_Width], m4_default([$4], 79))dnl
 m4_pushdef([m4_Cursor], m4_len(m4_Prefix1))dnl
@@ -1633,13 +1573,13 @@ m4_Prefix1[]dnl
 m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
       1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
 m4_Prefix])[]dnl
-m4_foreach([m4_Word], m4_quote(m4_split(m4_normalize([$1]))),
+m4_foreach_w([m4_Word], [$1],
 [m4_define([m4_Cursor], m4_eval(m4_Cursor + m4_len(m4_defn([m4_Word])) + 1))dnl
 dnl New line if too long, else insert a space unless it is the first
 dnl of the words.
 m4_if(m4_eval(m4_Cursor > m4_Width),
       1, [m4_define([m4_Cursor],
-                    m4_eval(m4_len(m4_Prefix) + m4_len(m4_defn([m4_Word])) + 
1))]
+                   m4_eval(m4_len(m4_Prefix) + m4_len(m4_defn([m4_Word])) + 
1))]
 m4_Prefix,
        [m4_Separator])[]dnl
 m4_defn([m4_Word])[]dnl
@@ -1661,6 +1601,21 @@ m4_define([m4_text_box],
 ])
 
 
+# m4_qlen(STRING)
+# ---------------
+# Expands to the length of STRING after autom4te converts all quadrigraphs.
+m4_define([m4_qlen],
+[m4_len(m4_bpatsubsts([[$1]], address@hidden(<:\|:>\|S|\|%:\)@], [P], 
[@&address@hidden))])
+
+
+# m4_qdelta(STRING)
+# -----------------
+# Expands to the net change in the length of STRING from autom4te converting 
the
+# quadrigraphs in STRING.  This number is always negative or zero.
+m4_define([m4_qdelta],
+[m4_eval(m4_qlen([$1]) - m4_len([$1]))])
+
+
 
 ## ----------------------- ##
 ## 10. Number processing.  ##
@@ -1672,9 +1627,9 @@ m4_define([m4_text_box],
 # The sign of the integer A.
 m4_define([m4_sign],
 [m4_bmatch([$1],
-           [^-], -1,
-           [^0+], 0,
-                  1)])
+          [^-], -1,
+          [^0+], 0,
+                 1)])
 
 # m4_cmp(A, B)
 # ------------
@@ -1703,9 +1658,9 @@ m4_define([m4_list_cmp],
        [$1], [()], [$0((0), [$2])],
        [$2], [()], [$0([$1], (0))],
        [m4_case(m4_cmp(m4_car$1, m4_car$2),
-                -1, -1,
-                 1, 1,
-                 0, [$0((m4_shift$1), (m4_shift$2))])])])
+               -1, -1,
+                1, 1,
+                0, [$0((m4_shift$1), (m4_shift$2))])])])
 
 
 
@@ -1725,14 +1680,14 @@ m4_define([m4_list_cmp],
 # reasonable version numbers and is valid up to `z', no double letters.
 m4_define([m4_version_unletter],
 [m4_translit(m4_bpatsubsts([$1],
-                           [\([0-9]+\)\([abcdefghi]\)],
-                             [m4_eval(\1 + 1).-1.\2],
-                           [\([0-9]+\)\([jklmnopqrs]\)],
-                             [m4_eval(\1 + 1).-1.1\2],
-                           [\([0-9]+\)\([tuvwxyz]\)],
-                             [m4_eval(\1 + 1).-1.2\2]),
-             [abcdefghijklmnopqrstuvwxyz],
-             [12345678901234567890123456])])
+                          [\([0-9]+\)\([abcdefghi]\)],
+                            [m4_eval(\1 + 1).-1.\2],
+                          [\([0-9]+\)\([jklmnopqrs]\)],
+                            [m4_eval(\1 + 1).-1.1\2],
+                          [\([0-9]+\)\([tuvwxyz]\)],
+                            [m4_eval(\1 + 1).-1.2\2]),
+            [abcdefghijklmnopqrstuvwxyz],
+            [12345678901234567890123456])])
 
 
 # m4_version_compare(VERSION-1, VERSION-2)
@@ -1743,7 +1698,16 @@ m4_define([m4_version_unletter],
 #   1 if           >
 m4_define([m4_version_compare],
 [m4_list_cmp((m4_split(m4_version_unletter([$1]), [\.])),
-             (m4_split(m4_version_unletter([$2]), [\.])))])
+            (m4_split(m4_version_unletter([$2]), [\.])))])
+
+
+# m4_PACKAGE_NAME
+# m4_PACKAGE_TARNAME
+# m4_PACKAGE_VERSION
+# m4_PACKAGE_STRING
+# m4_PACKAGE_BUGREPORT
+# --------------------
+#m4_include([m4sugar/version.m4]) # This is needed for Autoconf, but not Bison.
 
 
 # m4_version_prereq(VERSION, [IF-OK], [IF-NOT = FAIL])
@@ -1752,7 +1716,8 @@ m4_define([m4_version_compare],
 m4_define([m4_version_prereq],
 [m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [$1]), -1,
        [m4_default([$3],
-                   [m4_fatal([Autoconf version $1 or higher is required])])],
+                  [m4_fatal([Autoconf version $1 or higher is required],
+                            63)])],
        [$2])[]dnl
 ])
 
@@ -1795,8 +1760,7 @@ m4_pattern_forbid([^dnl$])
 
 # Check the divert push/pop perfect balance.
 m4_wrap([m4_ifdef([_m4_divert_diversion],
-                  [m4_fatal([$0: unbalanced m4_divert_push:]
-m4_defn([m4_divert_stack]))])[]])
+          [m4_fatal([$0: unbalanced m4_divert_push:]_m4_divert_n_stack)])[]])
 
 m4_divert_push([KILL])
 m4_wrap([m4_divert_pop([KILL])[]])
Index: doc/bison.texinfo
===================================================================
RCS file: /cvsroot/bison/bison/doc/bison.texinfo,v
retrieving revision 1.154
diff -p -u -r1.154 bison.texinfo
--- doc/bison.texinfo   21 Jul 2005 20:53:03 -0000      1.154
+++ doc/bison.texinfo   24 Jul 2005 07:20:55 -0000
@@ -7425,6 +7425,9 @@ parser's to get the set of defined token
 @comment file: calc++-scanner.ll
 @example
 address@hidden                                            /* -*- C++ -*- */
+# include <cstdlib>
+# include <errno.h>
+# include <limits.h>
 # include <string>
 # include "calc++-driver.hh"
 # include "calc++-parser.hh"
@@ -7482,7 +7485,14 @@ errors.
 @example
 [-+*/]     return yytext[0];
 ":="       return TOKEN_ASSIGN;
address@hidden@}      yylval->ival = atoi (yytext); return TOKEN_NUMBER;
address@hidden@}      @{
+  errno = 0;
+  long n = strtol (yytext, NULL, 10);
+  if (! (INT_MIN <= n && n <= INT_MAX && errno != ERANGE))
+    driver.error (*yylloc, "integer is out of range");
+  yylval->ival = n;
+  return TOKEN_NUMBER;
address@hidden
 @address@hidden       yylval->sval = new std::string (yytext); return 
TOKEN_IDENTIFIER;
 .          driver.error (*yylloc, "invalid character");
 %%
Index: lib/abitset.h
===================================================================
RCS file: /cvsroot/bison/bison/lib/abitset.h,v
retrieving revision 1.5
diff -p -u -r1.5 abitset.h
--- lib/abitset.h       14 May 2005 06:49:47 -0000      1.5
+++ lib/abitset.h       24 Jul 2005 07:20:55 -0000
@@ -17,7 +17,7 @@ along with this program; if not, write t
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 
 */
 
 #ifndef _ABITSET_H
-#define _ABITSET_H 
+#define _ABITSET_H
 
 #include "bitset.h"
 
Index: lib/bbitset.h
===================================================================
RCS file: /cvsroot/bison/bison/lib/bbitset.h,v
retrieving revision 1.17
diff -p -u -r1.17 bbitset.h
--- lib/bbitset.h       14 May 2005 06:49:47 -0000      1.17
+++ lib/bbitset.h       24 Jul 2005 07:20:55 -0000
@@ -34,7 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fi
    BITSET_TABLE:  Expandable table of pointers to arrays of bits
                  (variable size, less storage for large sparse sets).
                   Faster than BITSET_LIST for random access.
-   BITSET_VARRAY: Variable array of bits (variable size, fast for 
+   BITSET_VARRAY: Variable array of bits (variable size, fast for
                   dense bitsets).
    BITSET_STATS:  Wrapper bitset for internal use only.  Used for gathering
                   statistics and/or better run-time checking.
Index: lib/bitset.h
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitset.h,v
retrieving revision 1.17
diff -p -u -r1.17 bitset.h
--- lib/bitset.h        14 May 2005 06:49:47 -0000      1.17
+++ lib/bitset.h        24 Jul 2005 07:20:55 -0000
@@ -309,8 +309,8 @@ extern void bitset_dump (FILE *, bitset)
 */
 #define BITSET_FOR_EACH(ITER, BSET, INDEX, MIN)                                
      \
   for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE;                       \
-       (ITER.num == BITSET_LIST_SIZE)                                        \
-       && (ITER.num = bitset_list (BSET, ITER.list,                          \
+       (ITER.num == BITSET_LIST_SIZE)                                        \
+       && (ITER.num = bitset_list (BSET, ITER.list,                          \
                                   BITSET_LIST_SIZE, &ITER.next));)           \
     for (ITER.i = 0;                                                         \
         ITER.i < ITER.num && ((INDEX) = ITER.list[ITER.i], 1);               \
@@ -331,7 +331,7 @@ extern void bitset_dump (FILE *, bitset)
 */
 #define BITSET_FOR_EACH_REVERSE(ITER, BSET, INDEX, MIN)                        
      \
   for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE;                       \
-       (ITER.num == BITSET_LIST_SIZE)                                        \
+       (ITER.num == BITSET_LIST_SIZE)                                        \
        && (ITER.num = bitset_list_reverse (BSET, ITER.list,                  \
                                           BITSET_LIST_SIZE, &ITER.next));)   \
     for (ITER.i = 0;                                                         \
@@ -386,4 +386,3 @@ extern void debug_bitset (bitset);
 extern void debug_bitset_stats (void);
 
 #endif /* _BITSET_H  */
-
Index: lib/bitset_stats.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitset_stats.c,v
retrieving revision 1.15
diff -p -u -r1.15 bitset_stats.c
--- lib/bitset_stats.c  22 Jul 2005 22:31:40 -0000      1.15
+++ lib/bitset_stats.c  24 Jul 2005 07:20:55 -0000
@@ -50,29 +50,29 @@
 
 
 /* Accessor macros.  */
-#define BITSET_STATS_ALLOCS_INC(TYPE)                  \
+#define BITSET_STATS_ALLOCS_INC(TYPE)                  \
     bitset_stats_info->types[(TYPE)].allocs++
-#define BITSET_STATS_FREES_INC(BSET)                   \
+#define BITSET_STATS_FREES_INC(BSET)                   \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].frees++
-#define BITSET_STATS_SETS_INC(BSET)                    \
+#define BITSET_STATS_SETS_INC(BSET)                    \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].sets++
-#define BITSET_STATS_CACHE_SETS_INC(BSET)              \
+#define BITSET_STATS_CACHE_SETS_INC(BSET)              \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_sets++
-#define BITSET_STATS_RESETS_INC(BSET)                  \
+#define BITSET_STATS_RESETS_INC(BSET)                  \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].resets++
-#define BITSET_STATS_CACHE_RESETS_INC(BSET)            \
+#define BITSET_STATS_CACHE_RESETS_INC(BSET)            \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_resets++
-#define BITSET_STATS_TESTS_INC(BSET)                   \
+#define BITSET_STATS_TESTS_INC(BSET)                   \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].tests++
-#define BITSET_STATS_CACHE_TESTS_INC(BSET)             \
+#define BITSET_STATS_CACHE_TESTS_INC(BSET)             \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_tests++
-#define BITSET_STATS_LISTS_INC(BSET)                   \
+#define BITSET_STATS_LISTS_INC(BSET)                   \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].lists++
-#define BITSET_STATS_LIST_COUNTS_INC(BSET, I)          \
+#define BITSET_STATS_LIST_COUNTS_INC(BSET, I)          \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_counts[(I)]++
-#define BITSET_STATS_LIST_SIZES_INC(BSET, I)           \
+#define BITSET_STATS_LIST_SIZES_INC(BSET, I)           \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_sizes[(I)]++
-#define BITSET_STATS_LIST_DENSITY_INC(BSET, I)                 \
+#define BITSET_STATS_LIST_DENSITY_INC(BSET, I)         \
     bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_density[(I)]++
 
 
Index: lib/ebitset.h
===================================================================
RCS file: /cvsroot/bison/bison/lib/ebitset.h,v
retrieving revision 1.7
diff -p -u -r1.7 ebitset.h
--- lib/ebitset.h       14 May 2005 06:49:47 -0000      1.7
+++ lib/ebitset.h       24 Jul 2005 07:20:55 -0000
@@ -17,7 +17,7 @@ along with this program; if not, write t
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 
 */
 
 #ifndef _EBITSET_H
-#define _EBITSET_H 
+#define _EBITSET_H
 
 #include "bitset.h"
 
Index: lib/lbitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/lbitset.c,v
retrieving revision 1.15
diff -p -u -r1.15 lbitset.c
--- lib/lbitset.c       14 May 2005 06:49:47 -0000      1.15
+++ lib/lbitset.c       24 Jul 2005 07:20:55 -0000
@@ -41,7 +41,7 @@
 /* Number of words to use for each element.  The larger the value the
    greater the size of the cache and the shorter the time to find a given bit
    but the more memory wasted for sparse bitsets and the longer the time
-   to search for set bits. 
+   to search for set bits.
 
    The routines that dominate timing profiles are lbitset_elt_find
    and lbitset_elt_link, especially when accessing the bits randomly.  */
@@ -888,18 +888,18 @@ lbitset_unused_clear (bitset dst)
 
   n_bits = BITSET_SIZE_ (dst);
   last_bit = n_bits % LBITSET_ELT_BITS;
-  
+
   if (last_bit)
     {
       lbitset_elt *elt;
       bitset_windex windex;
       bitset_word *srcp;
-      
+
       elt = LBITSET_TAIL (dst);
       srcp = elt->words;
       windex = n_bits / BITSET_WORD_BITS;
-  
-      srcp[windex - elt->index] &= ((bitset_word) 1 << last_bit) - 1;    
+
+      srcp[windex - elt->index] &= ((bitset_word) 1 << last_bit) - 1;
       windex++;
 
       for (; (windex - elt->index) < LBITSET_ELT_WORDS; windex++)
Index: lib/lbitset.h
===================================================================
RCS file: /cvsroot/bison/bison/lib/lbitset.h,v
retrieving revision 1.7
diff -p -u -r1.7 lbitset.h
--- lib/lbitset.h       14 May 2005 06:49:47 -0000      1.7
+++ lib/lbitset.h       24 Jul 2005 07:20:55 -0000
@@ -17,7 +17,7 @@ along with this program; if not, write t
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 
 */
 
 #ifndef _LBITSET_H
-#define _LBITSET_H 
+#define _LBITSET_H
 
 #include "bitset.h"
 
Index: lib/subpipe.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/subpipe.c,v
retrieving revision 1.6
diff -p -u -r1.6 subpipe.c
--- lib/subpipe.c       20 Jul 2005 21:12:54 -0000      1.6
+++ lib/subpipe.c       24 Jul 2005 07:20:55 -0000
@@ -44,9 +44,7 @@
 # define STDOUT_FILENO 1
 #endif
 #if ! HAVE_DUP2 && ! defined dup2
-# if HAVE_FCNTL_H
-#  include <fcntl.h>
-# endif
+# include <fcntl.h>
 # define dup2(f, t) (close (t), fcntl (f, F_DUPFD, t))
 #endif
 
@@ -109,11 +107,13 @@ create_subpipe (char const * const *argv
       || pipe (pipe_fd) != 0
       || (fd[1] = fd_safer (pipe_fd[0])) < 0
       || (child_fd[1] = fd_safer (pipe_fd[1])) < 0)
-    error (EXIT_FAILURE, errno, "pipe");
+    error (EXIT_FAILURE, errno,
+          "pipe");
 
   pid = vfork ();
   if (pid < 0)
-    error (EXIT_FAILURE, errno, "fork");
+    error (EXIT_FAILURE, errno,
+          "fork");
 
   if (! pid)
     {
@@ -148,7 +148,8 @@ reap_subpipe (pid_t pid, char const *pro
 #if HAVE_WAITPID || defined waitpid
   int wstatus;
   if (waitpid (pid, &wstatus, 0) < 0)
-    error (EXIT_FAILURE, errno, "waitpid");
+    error (EXIT_FAILURE, errno,
+          "waitpid");
   else
     {
       int status = WIFEXITED (wstatus) ? WEXITSTATUS (wstatus) : -1;
Index: lib/timevar.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/timevar.c,v
retrieving revision 1.7
diff -p -u -r1.7 timevar.c
--- lib/timevar.c       14 May 2005 06:49:47 -0000      1.7
+++ lib/timevar.c       24 Jul 2005 07:20:55 -0000
@@ -31,7 +31,7 @@ Software Foundation, 51 Franklin Street,
 /* This source file is taken from the GCC source code, with slight
    modifications that are under control of the IN_GCC preprocessor
    variable.  The !IN_GCC part of this file is specific to Bison.  */
-   
+
 # include "../src/system.h"
 # if HAVE_SYS_TIME_H
 #  include <sys/time.h>
Index: lib/vbitset.h
===================================================================
RCS file: /cvsroot/bison/bison/lib/vbitset.h,v
retrieving revision 1.3
diff -p -u -r1.3 vbitset.h
--- lib/vbitset.h       14 May 2005 06:49:47 -0000      1.3
+++ lib/vbitset.h       24 Jul 2005 07:20:55 -0000
@@ -17,7 +17,7 @@ along with this program; if not, write t
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 
 */
 
 #ifndef _VBITSET_H
-#define _VBITSET_H 
+#define _VBITSET_H
 
 #include "bitset.h"
 
Index: m4/subpipe.m4
===================================================================
RCS file: /cvsroot/bison/bison/m4/subpipe.m4,v
retrieving revision 1.3
diff -p -u -r1.3 subpipe.m4
--- m4/subpipe.m4       14 May 2005 06:49:47 -0000      1.3
+++ m4/subpipe.m4       24 Jul 2005 07:20:55 -0000
@@ -1,7 +1,7 @@
 # -*- Autoconf -*-
 # Checks required to run `subpipe'.
 #
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
 #
 # 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
@@ -23,7 +23,6 @@
 AC_DEFUN([BISON_PREREQ_SUBPIPE],
 [
  AC_TYPE_PID_T
- AC_CHECK_HEADERS([fcntl.h])
  AC_HEADER_SYS_WAIT
  AC_CHECK_FUNCS(dup2 waitpid)
  AC_FUNC_FORK
Index: src/Makefile.am
===================================================================
RCS file: /cvsroot/bison/bison/src/Makefile.am,v
retrieving revision 1.64
diff -p -u -r1.64 Makefile.am
--- src/Makefile.am     14 May 2005 06:49:47 -0000      1.64
+++ src/Makefile.am     24 Jul 2005 07:20:55 -0000
@@ -15,9 +15,7 @@
 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 ## 02110-1301  USA
 
-DEFS = @DEFS@ \
-  -DPKGDATADIR=\"$(pkgdatadir)\" \
-  -DLOCALEDIR=\"$(datadir)/locale\"
+DEFS += -DPKGDATADIR=\"$(pkgdatadir)\" -DLOCALEDIR=\"$(datadir)/locale\"
 
 AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS)
 AM_CPPFLAGS = -I$(top_srcdir)/lib -I../lib
@@ -33,7 +31,7 @@ bin_PROGRAMS = bison
 bin_SCRIPTS = $(YACC_SCRIPT)
 EXTRA_SCRIPTS = yacc
 
-bison_SOURCES =                                  \
+bison_SOURCES =                                          \
        LR0.c LR0.h                               \
        assoc.c assoc.h                           \
        closure.c closure.h                       \
@@ -56,7 +54,7 @@ bison_SOURCES =                                 \
        reduce.c reduce.h                         \
        relation.c relation.h                     \
        scan-gram.l                               \
-       scan-skel.l                               \
+       scan-skel.h scan-skel.l                   \
        state.c state.h                           \
        symlist.c symlist.h                       \
        symtab.c symtab.h                         \
@@ -77,3 +75,34 @@ yacc:
 
 echo:
        echo $(bison_SOURCES) $(noinst_HEADERS)
+
+# The following rule is not designed to be portable,
+# and relies on tools that not everyone has.
+
+# Most functions in src/*.c should have static scope.
+# Any that don't must be marked with `extern', but `main'
+# and `usage' are exceptions.  They're always extern, but
+# don't need to be marked.
+#
+# The second nm|grep checks for file-scope variables with `extern' scope.
+sc_tight_scope: $(all_programs)
+       @t=exceptions-$$$$;                                             \
+       trap 's=$$?; rm -f $$t; exit $$s' 0 1 2 13 15;                  \
+       ( printf '^main$$\n^usage$$\n';                                 \
+         grep -h -A1 '^extern .*[^;]$$' $(SOURCES)                     \
+           | grep -vE '^(extern |--)' |sed 's/^/^/;s/ .*/$$/' ) > $$t; \
+       if nm -e *.$(OBJEXT)                                            \
+           | sed -n 's/.* T //p'                                       \
+           | grep -Ev -f $$t; then                                     \
+         echo 'the above functions should have static scope' 1>&2;     \
+         exit 1;                                                       \
+       fi;                                                             \
+       ( printf '^program_name$$\n';                                   \
+         sed -n 's/^extern .*[* ]\([a-zA-Z_][a-zA-Z_0-9]*\);$$/^\1$$/p' \
+           $$(ls $(SOURCES) | grep '\.h$$') /dev/null) > $$t;          \
+       if nm -e *.$(OBJEXT)                                            \
+           | sed -n 's/.* [BD] //p'                                    \
+           | grep -Ev -f $$t; then                                     \
+         echo 'the above variables should have static scope' 1>&2;     \
+         exit 1;                                                       \
+       fi
Index: src/files.c
===================================================================
RCS file: /cvsroot/bison/bison/src/files.c,v
retrieving revision 1.89
diff -p -u -r1.89 files.c
--- src/files.c 22 May 2005 17:52:12 -0000      1.89
+++ src/files.c 24 Jul 2005 07:20:55 -0000
@@ -66,9 +66,9 @@ static char *full_base_name = NULL;
 char *short_base_name = NULL;
 
 /* C source file extension (the parser source).  */
-const char *src_extension = NULL;
+static char const *src_extension = NULL;
 /* Header file extension (if option ``-d'' is specified).  */
-const char *header_extension = NULL;
+static char const *header_extension = NULL;
 
 /*-----------------------------------------------------------------.
 | Return a newly allocated string composed of the concatenation of |
Index: src/getargs.c
===================================================================
RCS file: /cvsroot/bison/bison/src/getargs.c,v
retrieving revision 1.62
diff -p -u -r1.62 getargs.c
--- src/getargs.c       12 Jul 2005 23:28:54 -0000      1.62
+++ src/getargs.c       24 Jul 2005 07:20:55 -0000
@@ -285,7 +285,7 @@ warranty; not even for MERCHANTABILITY o
 `----------------------*/
 
 /* Shorts options.  */
-const char *short_options = "yvegdhr:ltknVo:b:p:S:T::";
+static char const short_options[] = "yvegdhr:ltknVo:b:p:S:T::";
 
 /* Values for long options that do not have single-letter equivalents.  */
 enum
Index: src/getargs.h
===================================================================
RCS file: /cvsroot/bison/bison/src/getargs.h,v
retrieving revision 1.27
diff -p -u -r1.27 getargs.h
--- src/getargs.h       14 May 2005 06:49:47 -0000      1.27
+++ src/getargs.h       24 Jul 2005 07:20:55 -0000
@@ -1,5 +1,5 @@
 /* Parse command line arguments for bison.
-   Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004
+   Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -23,8 +23,12 @@
 # define GETARGS_H_
 
 /* flags set by % directives */
-extern const char *skeleton;           /* for -S */
-extern const char *include;            /* for -I */
+
+/* for -S */
+extern char const *skeleton;
+
+/* for -I */
+extern char const *include;
 
 extern bool debug_flag;                        /* for -t */
 extern bool defines_flag;              /* for -d */
Index: src/gram.c
===================================================================
RCS file: /cvsroot/bison/bison/src/gram.c,v
retrieving revision 1.54
diff -p -u -r1.54 gram.c
--- src/gram.c  14 May 2005 06:49:47 -0000      1.54
+++ src/gram.c  24 Jul 2005 07:20:55 -0000
@@ -269,7 +269,7 @@ grammar_dump (FILE *out, const char *tit
        rule *rule_i = &rules[i];
        item_number *rp = NULL;
        unsigned int rhs_itemno = rule_i->rhs - ritem;
-       unsigned int rhs_count = 0;
+       unsigned int rhs_count = 0;
        /* Find the last RHS index in ritems. */
        for (rp = rule_i->rhs; *rp >= 0; ++rp)
          ++rhs_count;
Index: src/main.c
===================================================================
RCS file: /cvsroot/bison/bison/src/main.c,v
retrieving revision 1.81
diff -p -u -r1.81 main.c
--- src/main.c  12 Jul 2005 23:28:54 -0000      1.81
+++ src/main.c  24 Jul 2005 07:20:55 -0000
@@ -56,9 +56,9 @@ main (int argc, char *argv[])
 {
   program_name = argv[0];
   setlocale (LC_ALL, "");
-  bindtextdomain (PACKAGE, LOCALEDIR);
-  bindtextdomain ("bison-runtime", LOCALEDIR);
-  textdomain (PACKAGE);
+  (void) bindtextdomain (PACKAGE, LOCALEDIR);
+  (void) bindtextdomain ("bison-runtime", LOCALEDIR);
+  (void) textdomain (PACKAGE);
 
   uniqstrs_new ();
 
Index: src/muscle_tab.c
===================================================================
RCS file: /cvsroot/bison/bison/src/muscle_tab.c,v
retrieving revision 1.35
diff -p -u -r1.35 muscle_tab.c
--- src/muscle_tab.c    14 May 2005 06:49:47 -0000      1.35
+++ src/muscle_tab.c    24 Jul 2005 07:20:55 -0000
@@ -41,7 +41,7 @@ struct obstack muscle_obstack;
 /* Initial capacity of muscles hash table.  */
 #define HT_INITIAL_CAPACITY 257
 
-struct hash_table *muscle_table = NULL;
+static struct hash_table *muscle_table = NULL;
 
 static bool
 hash_compare_muscles (void const *x, void const *y)
Index: src/muscle_tab.h
===================================================================
RCS file: /cvsroot/bison/bison/src/muscle_tab.h,v
retrieving revision 1.14
diff -p -u -r1.14 muscle_tab.h
--- src/muscle_tab.h    14 May 2005 06:49:47 -0000      1.14
+++ src/muscle_tab.h    24 Jul 2005 07:20:55 -0000
@@ -40,14 +40,14 @@ extern struct obstack muscle_obstack;
 
 #define MUSCLE_INSERT_INT(Key, Value)                          \
 {                                                              \
-  obstack_fgrow1 (&muscle_obstack, "%d", Value);               \
+  obstack_fgrow1 (&muscle_obstack, "%d", Value);               \
   obstack_1grow (&muscle_obstack, 0);                          \
   muscle_insert (Key, obstack_finish (&muscle_obstack));       \
 }
 
 #define MUSCLE_INSERT_LONG_INT(Key, Value)                     \
 {                                                              \
-  obstack_fgrow1 (&muscle_obstack, "%ld", Value);              \
+  obstack_fgrow1 (&muscle_obstack, "%ld", Value);              \
   obstack_1grow (&muscle_obstack, 0);                          \
   muscle_insert (Key, obstack_finish (&muscle_obstack));       \
 }
Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.234
diff -p -u -r1.234 output.c
--- src/output.c        22 Jul 2005 17:07:31 -0000      1.234
+++ src/output.c        24 Jul 2005 07:20:55 -0000
@@ -36,12 +36,10 @@
 #include "muscle_tab.h"
 #include "output.h"
 #include "reader.h"
+#include "scan-skel.h"
 #include "symtab.h"
 #include "tables.h"
 
-/* From src/scan-skel.l. */
-void scan_skel (FILE *);
-
 
 static struct obstack format_obstack;
 
@@ -559,7 +557,8 @@ output_skeleton (void)
 
   out = fdopen (filter_fd[0], "w");
   if (! out)
-    error (EXIT_FAILURE, get_errno (), "fdopen");
+    error (EXIT_FAILURE, get_errno (),
+          "fdopen");
 
   /* Output the definitions of all the muscles.  */
   fputs ("m4_init()\n", out);
@@ -580,7 +579,8 @@ output_skeleton (void)
   timevar_push (TV_M4);
   in = fdopen (filter_fd[1], "r");
   if (! in)
-    error (EXIT_FAILURE, get_errno (), "fdopen");
+    error (EXIT_FAILURE, get_errno (),
+          "fdopen");
   scan_skel (in);
   xfclose (in);
   reap_subpipe (pid, m4);
Index: src/parse-gram.y
===================================================================
RCS file: /cvsroot/bison/bison/src/parse-gram.y,v
retrieving revision 1.55
diff -p -u -r1.55 parse-gram.y
--- src/parse-gram.y    12 Jul 2005 13:54:41 -0000      1.55
+++ src/parse-gram.y    24 Jul 2005 07:20:55 -0000
@@ -48,12 +48,12 @@ static void gram_error (location const *
 
 static void add_param (char const *, char *, location);
 
-symbol_class current_class = unknown_sym;
-uniqstr current_type = 0;
+static symbol_class current_class = unknown_sym;
+static uniqstr current_type = 0;
 symbol *current_lhs;
 location current_lhs_location;
 assoc current_assoc;
-int current_prec = 0;
+static int current_prec = 0;
 %}
 
 %debug
@@ -206,7 +206,7 @@ declaration:
 | "%defines"                               { defines_flag = true; }
 | "%error-verbose"                         { error_verbose = true; }
 | "%expect" INT                            { expected_sr_conflicts = $2; }
-| "%expect-rr" INT                        { expected_rr_conflicts = $2; }
+| "%expect-rr" INT                        { expected_rr_conflicts = $2; }
 | "%file-prefix" "=" string_content        { spec_file_prefix = $3; }
 | "%glr-parser"
   {
@@ -221,7 +221,7 @@ declaration:
 | "%locations"                             { locations_flag = true; }
 | "%name-prefix" "=" string_content        { spec_name_prefix = $3; }
 | "%no-lines"                              { no_lines_flag = true; }
-| "%nondeterministic-parser"              { nondeterministic_parser = true; }
+| "%nondeterministic-parser"              { nondeterministic_parser = true; }
 | "%output" "=" string_content             { spec_outfile = $3; }
 | "%parse-param {...}"                    { add_param ("parse_param", $1, @1); 
}
 | "%pure-parser"                           { pure_parser = true; }
Index: src/print_graph.c
===================================================================
RCS file: /cvsroot/bison/bison/src/print_graph.c,v
retrieving revision 1.58
diff -p -u -r1.58 print_graph.c
--- src/print_graph.c   14 May 2005 06:49:48 -0000      1.58
+++ src/print_graph.c   24 Jul 2005 07:20:55 -0000
@@ -1,6 +1,6 @@
 /* Output a VCG description on generated parser, for Bison,
 
-   Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -21,7 +21,6 @@
 
 #include "system.h"
 
-#include <obstack.h>
 #include <quotearg.h>
 
 #include "LR0.h"
Index: src/reader.c
===================================================================
RCS file: /cvsroot/bison/bison/src/reader.c,v
retrieving revision 1.237
diff -p -u -r1.237 reader.c
--- src/reader.c        14 May 2005 06:49:48 -0000      1.237
+++ src/reader.c        24 Jul 2005 07:20:55 -0000
@@ -159,7 +159,7 @@ free_merger_functions (void)
 `-------------------------------------------------------------------*/
 
 /* The (currently) last symbol of GRAMMAR. */
-symbol_list *grammar_end = NULL;
+static symbol_list *grammar_end = NULL;
 
 /* Append SYM to the grammar.  */
 void
@@ -179,7 +179,7 @@ grammar_symbol_append (symbol *sym, loca
    CURRENT_RULE points to the first LHS of the current rule, while
    PREVIOUS_RULE_END points to the *end* of the previous rule (NULL).  */
 symbol_list *current_rule = NULL;
-symbol_list *previous_rule_end = NULL;
+static symbol_list *previous_rule_end = NULL;
 
 
 /*----------------------------------------------.
Index: src/reader.h
===================================================================
RCS file: /cvsroot/bison/bison/src/reader.h,v
retrieving revision 1.43
diff -p -u -r1.43 reader.h
--- src/reader.h        14 May 2005 06:49:48 -0000      1.43
+++ src/reader.h        24 Jul 2005 07:20:55 -0000
@@ -43,6 +43,11 @@ void scanner_initialize (void);
 void scanner_free (void);
 void scanner_last_string_free (void);
 
+/* These are declared by the scanner, but not used.  We put them here
+   to pacify "make syntax-check".  */
+extern FILE *gram_out;
+extern int gram_lineno;
+
 # define YY_DECL int gram_lex (YYSTYPE *val, location *loc)
 YY_DECL;
 
Index: src/scan-skel.l
===================================================================
RCS file: /cvsroot/bison/bison/src/scan-skel.l,v
retrieving revision 1.31
diff -p -u -r1.31 scan-skel.l
--- src/scan-skel.l     20 Jul 2005 21:23:35 -0000      1.31
+++ src/scan-skel.l     24 Jul 2005 07:20:55 -0000
@@ -31,21 +31,7 @@
 #include "complain.h"
 #include "getargs.h"
 #include "files.h"
-
-int skel_lex (void);
-
-/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used.  */
-int skel_get_lineno (void);
-FILE *skel_get_in (void);
-FILE *skel_get_out (void);
-int skel_get_leng (void);
-char *skel_get_text (void);
-void skel_set_lineno (int);
-void skel_set_in (FILE *);
-void skel_set_out (FILE *);
-int skel_get_debug (void);
-void skel_set_debug (int);
-int skel_lex_destroy (void);
+#include "scan-skel.h"
 
 #define QPUTS(String) \
    fputs (quotearg_style (c_quoting_style, (String)), yyout)
@@ -109,8 +95,6 @@ int skel_lex_destroy (void);
 /*------------------------.
 | Scan a Bison skeleton.  |
 `------------------------*/
-
-void scan_skel (FILE *);
 
 void
 scan_skel (FILE *in)
Index: src/system.h
===================================================================
RCS file: /cvsroot/bison/bison/src/system.h,v
retrieving revision 1.67
diff -p -u -r1.67 system.h
--- src/system.h        14 May 2005 06:49:48 -0000      1.67
+++ src/system.h        24 Jul 2005 07:20:55 -0000
@@ -130,9 +130,9 @@ typedef size_t uintptr_t;
 | Obstacks.  |
 `-----------*/
 
-# define obstack_chunk_alloc xmalloc
-# define obstack_chunk_free  free
-# include <obstack.h>
+#define obstack_chunk_alloc xmalloc
+#define obstack_chunk_free  free
+#include <obstack.h>
 
 #define obstack_sgrow(Obs, Str) \
   obstack_grow (Obs, Str, strlen (Str))
Index: src/tables.c
===================================================================
RCS file: /cvsroot/bison/bison/src/tables.c,v
retrieving revision 1.27
diff -p -u -r1.27 tables.c
--- src/tables.c        14 May 2005 06:49:48 -0000      1.27
+++ src/tables.c        24 Jul 2005 07:20:55 -0000
@@ -173,7 +173,7 @@ table_grow (int desired)
 
 /*-------------------------------------------------------------------.
 | For GLR parsers, for each conflicted token in S, as indicated      |
-| by non-zero entries in CONFLROW, create a list of possible        |
+| by non-zero entries in CONFLROW, create a list of possible        |
 | reductions that are alternatives to the shift or reduction        |
 | currently recorded for that token in S.  Store the alternative     |
 | reductions followed by a 0 in CONFLICT_LIST, updating                     |
Index: src/uniqstr.c
===================================================================
RCS file: /cvsroot/bison/bison/src/uniqstr.c,v
retrieving revision 1.5
diff -p -u -r1.5 uniqstr.c
--- src/uniqstr.c       14 May 2005 06:49:48 -0000      1.5
+++ src/uniqstr.c       24 Jul 2005 07:20:55 -0000
@@ -1,6 +1,6 @@
 /* Keep a unique copy of strings.
 
-   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -63,7 +63,8 @@ uniqstr_assert (char const *str)
 {
   if (!hash_lookup (uniqstrs_table, str))
     {
-      error (0, 0, "not a uniqstr: %s", quotearg (str));
+      error (0, 0,
+            "not a uniqstr: %s", quotearg (str));
       abort ();
     }
 }
Index: src/vcg.c
===================================================================
RCS file: /cvsroot/bison/bison/src/vcg.c,v
retrieving revision 1.20
diff -p -u -r1.20 vcg.c
--- src/vcg.c   14 May 2005 06:49:48 -0000      1.20
+++ src/vcg.c   24 Jul 2005 07:20:55 -0000
@@ -203,7 +203,7 @@ new_edge (edge *e)
 }
 
 /*----------------------------------------------.
-| Get functions.                                       |
+| Get functions.                               |
 | Return string corresponding to an enum value. |
 `----------------------------------------------*/
 
@@ -374,7 +374,7 @@ get_arrowstyle_str (enum arrowstyle arro
 }
 
 /*------------------------------.
-| Add functions.                       |
+| Add functions.               |
 | Edge and nodes into a graph.  |
 `------------------------------*/
 
Index: src/vcg_defaults.h
===================================================================
RCS file: /cvsroot/bison/bison/src/vcg_defaults.h,v
retrieving revision 1.8
diff -p -u -r1.8 vcg_defaults.h
--- src/vcg_defaults.h  14 May 2005 06:49:48 -0000      1.8
+++ src/vcg_defaults.h  24 Jul 2005 07:20:55 -0000
@@ -48,11 +48,11 @@
 # define G_TEXTMODE            centered
 # define G_SHAPE               box
 
-# define G_VERTICAL_ORDER      0       /* Unspecified for subgraphs. */
-# define G_HORIZONTAL_ORDER    0       /* Unspecified for subgraphs. */
+# define G_VERTICAL_ORDER      0       /* Unspecified for subgraphs.  */
+# define G_HORIZONTAL_ORDER    0       /* Unspecified for subgraphs.  */
 
-# define G_XMAX                        90      /* Not output */
-# define G_YMAX                        90      /* Not output */
+# define G_XMAX                        90      /* Not output.  */
+# define G_YMAX                        90      /* Not output.  */
 
 # define G_XBASE               5
 # define G_YBASE               5
@@ -65,9 +65,9 @@
 # define G_YRASTER             1
 # define G_XLRASTER            1
 
-# define G_HIDDEN              (-1)    /* No default value. */
+# define G_HIDDEN              (-1)    /* No default value.  */
 
-# define G_CLASSNAME           NULL    /* No class name association */
+# define G_CLASSNAME           NULL    /* No class name association.  */
 # define G_INFONAME            NULL
 # define G_COLORENTRY          NULL
 
Index: tests/Makefile.am
===================================================================
RCS file: /cvsroot/bison/bison/tests/Makefile.am,v
retrieving revision 1.40
diff -p -u -r1.40 Makefile.am
--- tests/Makefile.am   14 Jul 2005 17:27:01 -0000      1.40
+++ tests/Makefile.am   24 Jul 2005 07:20:55 -0000
@@ -32,11 +32,11 @@ MAINTAINERCLEANFILES = Makefile.in $(TES
 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
        {                                       \
          echo '# Signature of the current package.'; \
-         echo 'm4_define([AT_PACKAGE_NAME],      address@hidden@])'; \
-         echo 'm4_define([AT_PACKAGE_TARNAME],   address@hidden@])'; \
-         echo 'm4_define([AT_PACKAGE_VERSION],   address@hidden@])'; \
-         echo 'm4_define([AT_PACKAGE_STRING],    address@hidden@])'; \
-         echo 'm4_define([AT_PACKAGE_BUGREPORT], address@hidden@])'; \
+         echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])'; \
+         echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])'; \
+         echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])'; \
+         echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])'; \
+         echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
        } >$(srcdir)/package.m4
 
 ## ------------ ##
Index: tests/cxx-type.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/cxx-type.at,v
retrieving revision 1.26
diff -p -u -r1.26 cxx-type.at
--- tests/cxx-type.at   20 Jul 2005 22:01:47 -0000      1.26
+++ tests/cxx-type.at   24 Jul 2005 07:20:55 -0000
@@ -83,7 +83,7 @@ prog :
 stmt : expr ';'  $2    { $$ = ]$[1; }
      | decl      $3
      | error ';'       { static char error_msg[] = "<error>"; $$ = error_msg; }
-     | '@'             { YYACCEPT; }
+     | '@'             { YYACCEPT; }
      ;
 
 expr : ID
@@ -145,7 +145,7 @@ yylex (LEX_PARAMETERS)
          break;
        case ' ': case '\f':
          colNum += 1;
-         break;
+         break;
        case '\n':
          lineNum += 1;
          colNum = 0;
Index: tests/existing.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/existing.at,v
retrieving revision 1.7
diff -p -u -r1.7 existing.at
--- tests/existing.at   14 May 2005 06:49:48 -0000      1.7
+++ tests/existing.at   24 Jul 2005 07:20:55 -0000
@@ -408,7 +408,7 @@ AT_DATA([[input.y]],
         HBEGPAR HENDPAR
         HEQR HNER
         HADD HSUB HMUL HDIV HINTDIV HEXP
-       HDOTDOTDOT
+       HDOTDOTDOT
 
 %token <ident> HIDENTIFIER
 %token <ival> HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
@@ -450,7 +450,7 @@ AT_DATA([[input.y]],
 MAIN_MODULE     :       {        categ=CLOCAL; mout(MBLOCK);
                                   beginBlock(KBLOKK);separat_comp=FALSE;}
                        MODULS  { endBlock(NULL,CCNO);   mout(MENDBLOCK);}
-               |       error HSTATEMENTSEPARATOR MBEE_DECLSTMS
+               |       error HSTATEMENTSEPARATOR MBEE_DECLSTMS
                ;
 EXT_DECLARATION        :       HEXTERNAL
                        MBEE_TYPE
@@ -548,7 +548,7 @@ MBEE_ELSE_PART  :       /*EMPT*/
 /*             |       HELSE
                        HIF
                         EXPRESSION
-                        HTHEN   {                mout(MELSE);
+                        HTHEN   {                mout(MELSE);
                                                  mout(MIF);
                                   OBSBLOCK();}
                         BLOCK   { MBEEENDBLOCK();}
@@ -588,7 +588,7 @@ WHEN_CLAUSE_LIST:       HWHEN
                         HIDENTIFIER
                         HDO    {   beginBlock(KCON);  mout(MIDENTIFIER);
                                    OBSBLOCK();     moutId($2);
-                                                  mout(MWHEN);}
+                                                  mout(MWHEN);}
                         BLOCK  {   endBlock(NULL,CCNO);
                               MBEEENDBLOCK(); mout(MENDWHEN);}
                 |       WHEN_CLAUSE_LIST
@@ -596,7 +596,7 @@ WHEN_CLAUSE_LIST:       HWHEN
                         HIDENTIFIER
                         HDO    { beginBlock(KCON);        mout(MIDENTIFIER);
                                  OBSBLOCK();       moutId($3);
-                                                  mout(MWHEN);}
+                                                  mout(MWHEN);}
                         BLOCK  { endBlock(NULL,CCNO);
                               MBEEENDBLOCK();    mout(MENDWHEN);}
                 ;
@@ -645,8 +645,8 @@ MODULSTATEMENT  :       HWHILE
                         HDO     { STOPOBSBLOCK(); mout(MWHILE);
                                   OBSBLOCK();}
                         BLOCK   { MBEEENDBLOCK(); mout(MENDWHILE);
-                                                         $$=STATEMENT;}
-               |       HIF
+                                                         $$=STATEMENT;}
+               |       HIF
                         EXPRESSION
                         HTHEN   { STOPOBSBLOCK(); mout(MIF);
                                   OBSBLOCK();}
@@ -709,7 +709,7 @@ MODULSTATEMENT  :       HWHILE
                                 { STOPOBSBLOCK();         $$=STATEMENT;
                                                   mout(MENDASSIGN);}
                |       ACTIVATOR EXPRESSION SCHEDULE
-                                               {         $$=STATEMENT;
+                                               { $$=STATEMENT;
                                                  mout(MENDSEP);
                                                  mout(MARGUMENTSEP);
                                                  mout(MARGUMENTSEP);
@@ -836,10 +836,10 @@ MBEE_DECLSTMSU  :       DECLSTATEMENT   
 MODULS         :       MODULSTATEMENT  { if($1==DECLARATION)
                                          {separat_comp=TRUE;gettimestamp();}
                                           $$=$1;}
-               |       MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
+               |       MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
                                        { if($1>=STATEMENT && $3<=DECLARATION)
                                             yerror (26);else
-                                                 if($1>=STATEMENT
+                                         if($1>=STATEMENT
                                             && $3!=EMPTYSTATEMENT)yerror (25);
                                           if(separat_comp && $3==STATEMENT)
                                              yerror (25);
@@ -939,7 +939,7 @@ FPP_CATEG       :       HNAME HLABELSEPA
                 ;
 FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE
                         HIDENTIFIER
-                                       { $<ival>$=categ;
+                                       { $<ival>$=categ;
                                           regDecl($3, type, KPROC, categ);
                                           beginBlock(KPROC);}
                         FPP_HEADING
@@ -1008,7 +1008,7 @@ SPECIFIER       :       TYPE            
                 ;
 PROC_DECL_IN_SPEC:     MBEE_TYPE HPROCEDURE
                         HIDENTIFIER
-                                       { $<ival>$=categ;
+                                       { $<ival>$=categ;
                                           regDecl($3, type, KPROC, categ);
                                           beginBlock(KPROC);}
                         HEADING
@@ -1292,7 +1292,7 @@ AT_DATA([[input.y]],
 %token AND
 %token HERE
 %token DOT_N
-%token DOT_E   
+%token DOT_E
 %token DOT_W
 %token DOT_S
 %token DOT_NE
@@ -1378,7 +1378,7 @@ parses properly. */
 %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED
 %left LABEL
 
-%left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND 
SRAND LAST 
+%left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND 
SRAND LAST
 %left ORDINAL HERE '`'
 
 %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */
@@ -1518,7 +1518,7 @@ placeless_element:
                }
        | COPY TEXT THRU
                { delim_flag = 2; }
-         DELIMITED 
+         DELIMITED
                { delim_flag = 0; }
          until
                {
@@ -1542,13 +1542,13 @@ placeless_element:
                  a_delete $6;
                }
        | FOR VARIABLE '=' expr TO expr optional_by DO
-               { delim_flag = 1; }
+               { delim_flag = 1; }
          DELIMITED
-               {
+               {
                  delim_flag = 0;
                  if (yychar < 0)
                    do_lookahead();
-                 do_for($2, $4, $6, $7.is_multiplicative, $7.val, $10); 
+                 do_for($2, $4, $6, $7.is_multiplicative, $7.val, $10);
                }
        | simple_if
                {
@@ -1617,7 +1617,7 @@ print_args:
        ;
 
 print_arg:
-       expr                                                    %prec ','
+       expr                                                    %prec ','
                {
                  $$.str = new char[GDIGITS + 1];
                  sprintf($$.str, "%g", $1);
@@ -1652,14 +1652,14 @@ until:
        | UNTIL TEXT
                { $$ = $2.str; }
        ;
-       
+
 any_expr:
        expr
                { $$ = $1; }
        | text_expr
                { $$ = $1; }
        ;
-       
+
 text_expr:
        text EQUALEQUAL text
                {
@@ -1831,7 +1831,7 @@ object_spec:
                                           $3.filename, $3.lineno);
                  a_delete $3.str;
                }
-       | '[' 
+       | '['
                {
                  saved_state *p = new saved_state;
                  $<pstate>$ = p;
@@ -2014,7 +2014,7 @@ object_spec:
                  $$->segment_pos.y += $3.y;
                }
        | object_spec THEN
-               {
+               {
                  $$ = $1;
                  if ($$->flags & HAS_SEGMENT) {
                    $$->segment_list = new segment($$->segment_pos,
@@ -2088,7 +2088,7 @@ object_spec:
                  strcpy($$->outlined, $3.str);
                }
        | object_spec CHOP
-               {
+               {
                  $$ = $1;
                  // line chop chop means line chop 0 chop 0
                  if ($$->flags & IS_DEFAULT_CHOPPED) {
@@ -2258,10 +2258,10 @@ sprintf_args:
        ;
 
 position:
-       position_not_place
+       position_not_place
                { $$ = $1; }
        | place
-               {
+               {
                  position pos = $1;
                  $$.x = pos.x;
                  $$.y = pos.y;
@@ -2377,7 +2377,7 @@ ordinal:
 optional_ordinal_last:
        LAST
                { $$ = 1; }
-       | ordinal LAST
+       | ordinal LAST
                { $$ = $1; }
        ;
 
@@ -2416,7 +2416,7 @@ nth_primitive:
 
 object_type:
        BOX
-               { $$ = BOX_OBJECT; }
+               { $$ = BOX_OBJECT; }
        | CIRCLE
                { $$ = CIRCLE_OBJECT; }
        | ELLIPSE
@@ -2436,7 +2436,7 @@ object_type:
        ;
 
 label_path:
-       '.' LABEL
+       '.' LABEL
                { $$ = new path($2); }
        | label_path '.' LABEL
                {
@@ -2450,7 +2450,7 @@ relative_path:
                { $$ = new path($1); }
        /* give this a lower precedence than LEFT and RIGHT so that
           [A: box] with .A left == [A: box] with (.A left) */
-       | label_path                                            %prec TEXT
+       | label_path                                            %prec TEXT
                { $$ = $1; }
        | label_path corner
                {
@@ -2497,7 +2497,7 @@ path:
 corner:
        DOT_N
                { $$ = &object::north; }
-       | DOT_E 
+       | DOT_E
                { $$ = &object::east; }
        | DOT_W
                { $$ = &object::west; }
@@ -2517,7 +2517,7 @@ corner:
                { $$ = &object::start; }
        | DOT_END
                { $$ = &object::end; }
-       | TOP
+       | TOP
                { $$ = &object::north; }
        | BOTTOM
                { $$ = &object::south; }
@@ -2573,12 +2573,12 @@ expr:
        | NUMBER
                { $$ = $1; }
        | place DOT_X
-               {
+               {
                  if ($1.obj != 0)
                    $$ = $1.obj->origin().x;
                  else
                    $$ = $1.x;
-               }                       
+               }
        | place DOT_Y
                {
                  if ($1.obj != 0)
Index: tests/sets.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/sets.at,v
retrieving revision 1.18
diff -p -u -r1.18 sets.at
--- tests/sets.at       14 May 2005 06:49:48 -0000      1.18
+++ tests/sets.at       24 Jul 2005 07:20:55 -0000
@@ -1,5 +1,5 @@
 # Exercising Bison Grammar Sets.                      -*- Autotest -*-
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
 
 # 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
@@ -29,25 +29,25 @@ m4_define([AT_EXTRACT_SETS],
    :null
    p
    n
-   /^[         ]*$/ !b null
+   /^[  ]*$/ !b null
 }
 /^FIRSTS$/ {
    :firsts
    p
    n
-   /^[         ]*$/ !b firsts
+   /^[  ]*$/ !b firsts
 }
 /^FDERIVES$/ {
    :fderiv
    p
    n
-   /^[         ]*$/ !b fderiv
+   /^[  ]*$/ !b fderiv
 }
 /^DERIVES$/ {
    :deriv
    p
    n
-   /^[         ]*$/ !b deriv
+   /^[  ]*$/ !b deriv
 }
 ]])
 AT_CHECK([sed -f extract.sed $1], 0, [stdout])
Index: tests/torture.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/torture.at,v
retrieving revision 1.27
diff -p -u -r1.27 torture.at
--- tests/torture.at    18 Jul 2005 06:14:16 -0000      1.27
+++ tests/torture.at    24 Jul 2005 07:20:56 -0000
@@ -388,6 +388,8 @@ m4_define([AT_DATA_STACK_TORTURE],
 # exp:
 AT_DATA([input.y],
 [[%{
+#include <errno.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 ]$1[
@@ -406,9 +408,6 @@ yyerror (const char *msg)
   fprintf (stderr, "%s\n", msg);
 }
 
-/* There are YYLVAL_MAX of WAIT_FOR_EOFs. */
-unsigned int yylval_max;
-
 static int
 yylex (void)
 {
@@ -421,9 +420,14 @@ yylex (void)
 int
 main (int argc, const char **argv)
 {
+  char *endp;
   if (argc != 2)
     abort ();
-  yylval = atoi (argv[1]);
+  yylval = strtol (argv[1], &endp, 10);
+  if (! (argv[1] != endp
+        && 0 <= yylval && yylval <= INT_MAX
+        && errno != ERANGE))
+    abort ();
   yydebug = 1;
   return yyparse ();
 }
--- /dev/null   2005-06-27 15:40:05.000000000 -0700
+++ src/scan-skel.h     2005-07-23 21:53:39.000000000 -0700
@@ -0,0 +1,41 @@
+/* Scan Bison Skeletons.
+
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   Bison 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.
+
+   Bison is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Bison; see the file COPYING.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+void scan_skel (FILE *);
+
+/* Pacify "make syntax-check".  */
+extern FILE *skel_in;
+extern FILE *skel_out;
+extern int skel__flex_debug;
+extern int skel_lineno;
+
+/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used.  */
+int skel_get_lineno (void);
+FILE *skel_get_in (void);
+FILE *skel_get_out (void);
+int skel_get_leng (void);
+char *skel_get_text (void);
+void skel_set_lineno (int);
+void skel_set_in (FILE *);
+void skel_set_out (FILE *);
+int skel_get_debug (void);
+void skel_set_debug (int);
+int skel_lex_destroy (void);




reply via email to

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