bison-patches
[Top][All Lists]
Advanced

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

Re: A preprelease?


From: Paul Eggert
Subject: Re: A preprelease?
Date: Mon, 12 Aug 2002 10:32:44 -0700 (PDT)

> From: Akim Demaille <address@hidden>
> Date: 01 Aug 2002 12:39:31 +0200
> 
> I still have miserable access to the Internet at work (mail and web,
> no upload).  At home, it's a 56K modem...  I don't think I can really
> expect making the prerelease.  Would you handle it?

This took a bit longer than I expected, since I ran into problems
building and testing the prerelease on machines other than GNU/Linux
x86.  I fixed the problems I ran into.  I think the code still is
quite unreliable in the presence of very large (> 2 GiB) grammars and
inputs, but I didn't have time to check this.  So I finally made a
prerelease and put it out on gnudist, and it should appear on alpha
soon.  I'll send out an announcement when it's ready.

Here are the patches I installed.  In addition to the following patch
file, I removed m4/stage.m4, updated translations, regenerated
files that could be generated automatically, and added Paul Hilfinger
to the THANKS file.

2002-08-12  Paul Eggert  <address@hidden>

        Version 1.49b.

        * Makefile.am (SUBDIRS): Remove intl.
        (DISTCLEANFILES): Remove.
        * NEWS: Mention that GNU M4 is now required.  Clarify what is
        meant by "larger grammars".  Mention the pt_BR translation.
        * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
        (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
        Bump version from 0.11.2 to 0.11.5.
        (BISON_PREREQ_STAGE): Remove.
        (AM_GNU_GETTEXT): Use external gettext.
        (AC_OUTPUT): Remove intl/Makefile.

        * config/depcomp, config/install-sh: Sync with Automake 1.6.3.

        * data/glr.c: Include string.h, for strlen.
        (yyreportParseError): Use size_t for yysize.
        (yy_yypstack): No longer nested inside yypstates, as nested
        functions are not portable.  Do not assume size_t is the
        same width as int.
        (yypstates): Do not assume that ptrdiff_t is the same width
        as int, and similarly for yyposn and YYINDEX.

        * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.

        * lib/Makefile.am (INCLUDES): Do not include from the intl
        directory, which has been removed.
        * src/Makefile.am (INCLUDES): Likewise.

        * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
        (bitsets_sources, additional_bitsets_sources, timevars_sources):
        New vars.

        * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
        * tests/Makefile.am (EXTRA_DIST): Likewise.

        * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
        Do not assume that bitset_windex is the same width as unsigned.

        * lib/abitset.c (abitset_unused_clear): Do not assume that
        bitset_word is the same width as int.
        * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
        * lib/bitset.h (bitset_set, bitset_reset): Likewise.
        * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
        * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
        * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.

        * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
        portability to one's complement hosts!).
        * lib/ebitset.c (ebitset_op1): Likewise.
        * lib/lbitset.c (lbitset_op1): Likewise.

        * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
        * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
        lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
        Sync with fileutils.
        * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
        lib/gettext.h: Sync with diffutils.

        * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
        lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.

        * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
        PROTOTYPES to check for prototypes, and "defined __STDC__" to
        check for void *.

        * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
        size_t; the old version tried to do this but casted improperly.
        (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
        (bitset_test): Now returns int, not unsigned long.

        * lib/bitset_stats.c: Include "gettext.h".
        (_): New macro.
        (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
        name locals "index", as it generates unnecessary warnings on some
        hosts that have an "index" function.

        * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
        bitset_stats_read, bitset_stats_write): Wrap strings in _() if
        they need translation.
        * src/LR0.c (state_list_append, new_itemsets, get_state,
        append_states, generate_states): Likewise.
        * src/assoc.c (assoc_to_string): Likewise.
        * src/closure.c (print_closure, set_firsts, closure): Likewise.
        * src/gram.c (grammar_dump): Likewise.
        * src/injections.c (injections_compute): Likewise.
        * src/lalr.c (lookaheads_print): Likewise.
        * src/relation.c (relation_transpose): Likewise.
        * src/scan-gram.l: Likewise.
        * src/tables.c (table_grow, pack_vector): Likewise.

        * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
        glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
        * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
        * m4/mbstate_t.m4: Sync with fileutils.
        * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.

        * po/LINGUAS: Add pt_BR.
        * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
        src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
        lib/timevar.c.
        Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
        manual recommends.
        Similarly, use src/scan-gram.l instead of src/scan-gram.c.

        * src/complain.c (strerror_r): Remove decl; not needed.
        (strerror): Use same pattern as ../lib/error.c.

        * src/files.c, src/files.h (compute_header_macro): Remove; unused.

        * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.

        * src/main.c (main): Cast result of bindtextdomain and textdomain
        to void, to avoid a GCC warning when --disable-nls is in effect.

        * src/scan-gram.l: Use strings rather than escapes when possible,
        to minimize the number of warnings from xgettext.
        (handle_action_dollar, handle_action_at): Don't use isdigit,
        as it mishandles negative chars and it may not work as expected
        outside the C locale.

        * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
        this is a GCC extension and is not portable to other compilers.

        * src/system.h (alloca): Use same pattern as ../lib/error.c.
        Do not include <ctype.h>; no longer needed.
        Do not include <malloc.h>; no longer needed (and generates
        warnings on OpenBSD 3.0).

        * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
        it's not portable.

        * tests/regression.at: Do not use 'cc -c input.c -o input';
        Sun C rejects this.  Instead, use 'cc -c input.c -o input.o'.

        * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
        exit status as failure, not just exit status 1.  Sun C exits
        with status 2 sometimes.

        * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
        Use it for the two large tests.

diff -pru .del/bison2/config/depcomp bison/config/depcomp
--- .del/bison2/config/depcomp  2002-06-14 10:35:45.000000000 -0700
+++ bison/config/depcomp        2002-08-12 07:01:19.000000000 -0700
@@ -31,7 +31,16 @@ if test -z "$depmode" || test -z "$sourc
 fi
 # `libtool' can also be set to `yes' or `no'.
 
-depfile=${depfile-`echo "$object" | sed 
's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+if test -z "$depfile"; then
+   base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
+   dir=`echo "$object" | sed 's,/.*$,/,'`
+   if test "$dir" = "$object"; then
+      dir=
+   fi
+   # FIXME: should be _deps on DOS.
+   depfile="$dir.deps/$base"
+fi
+
 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
 
 rm -f "$tmpdepfile"
@@ -198,17 +207,22 @@ aix)
   ;;
 
 tru64)
-   # The Tru64 AIX compiler uses -MD to generate dependencies as a side
+   # The Tru64 compiler uses -MD to generate dependencies as a side
    # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
-   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
    # dependencies in `foo.d' instead, so we check for that too.
    # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
 
-   tmpdepfile1="$object.d"
-   tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 
    if test "$libtool" = yes; then
+      tmpdepfile1="$dir.libs/$base.lo.d"
+      tmpdepfile2="$dir.libs/$base.d"
       "$@" -Wc,-MD
    else
+      tmpdepfile1="$dir$base.o.d"
+      tmpdepfile2="$dir$base.d"
       "$@" -MD
    fi
 
@@ -240,34 +254,40 @@ tru64)
 
 dashmstdout)
   # Important note: in order to support this mode, a compiler *must*
-  # always write the proprocessed file to stdout, regardless of -o,
-  # because we must use -o when running libtool.
-  test -z "$dashmflag" && dashmflag=-M
-  ( IFS=" "
-    case " $* " in
-    *" --mode=compile "*) # this is libtool, let us make it quiet
-      for arg
-      do # cycle over the arguments
-        case "$arg" in
-       "--mode=compile")
-         # insert --quiet before "--mode=compile"
-         set fnord "$@" --quiet
-         shift # fnord
-         ;;
-       esac
-       set fnord "$@" "$arg"
-       shift # fnord
-       shift # "$arg"
-      done
+  # always write the proprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.  We will use -o /dev/null later,
+  # however we can't do the remplacement now because
+  # `-o $object' might simply not be used
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
       ;;
     esac
-    "$@" $dashmflag | sed 's:^[^:]*\:[         ]*:'"$object"'\: :' > 
"$tmpdepfile"
-  ) &
-  proc=$!
-  "$@"
-  stat=$?
-  wait "$proc"
-  if test "$stat" != 0; then exit $stat; fi
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[      ]*:'"$object"'\: :' > 
"$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
   tr ' ' '
@@ -285,36 +305,31 @@ dashXmstdout)
   ;;
 
 makedepend)
+  "$@" || exit $?
   # X makedepend
-  (
-    shift
-    cleared=no
-    for arg in "$@"; do
-      case $cleared in no)
-        set ""; shift
-       cleared=yes
-      esac
-      case "$arg" in
-        -D*|-I*)
-         set fnord "$@" "$arg"; shift;;
-       -*)
-         ;;
-       *)
-         set fnord "$@" "$arg"; shift;;
-      esac
-    done
-    obj_suffix="`echo $object | sed 's/^.*\././'`"
-    touch "$tmpdepfile"
-    ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
-  ) &
-  proc=$!
-  "$@"
-  stat=$?
-  wait "$proc"
-  if test "$stat" != 0; then exit $stat; fi
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    -*)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tail +3 "$tmpdepfile" | tr ' ' '
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
 ' | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
@@ -324,35 +339,39 @@ makedepend)
 
 cpp)
   # Important note: in order to support this mode, a compiler *must*
-  # always write the proprocessed file to stdout, regardless of -o,
-  # because we must use -o when running libtool.
-  ( IFS=" "
-    case " $* " in
-    *" --mode=compile "*)
-      for arg
-      do # cycle over the arguments
-        case $arg in
-       "--mode=compile")
-         # insert --quiet before "--mode=compile"
-         set fnord "$@" --quiet
-         shift # fnord
-         ;;
-       esac
-       set fnord "$@" "$arg"
-       shift # fnord
-       shift # "$arg"
-      done
+  # always write the proprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
       ;;
     esac
-    "$@" -E |
+  done
+
+  "$@" -E |
     sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
     sed '$ s: \\$::' > "$tmpdepfile"
-  ) &
-  proc=$!
-  "$@"
-  stat=$?
-  wait "$proc"
-  if test "$stat" != 0; then exit $stat; fi
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
   cat < "$tmpdepfile" >> "$depfile"
@@ -364,32 +383,25 @@ msvisualcpp)
   # Important note: in order to support this mode, a compiler *must*
   # always write the proprocessed file to stdout, regardless of -o,
   # because we must use -o when running libtool.
-  ( IFS=" "
-    case " $* " in
-    *" --mode=compile "*)
-      for arg
-      do # cycle over the arguments
-        case $arg in
-       "--mode=compile")
-         # insert --quiet before "--mode=compile"
-         set fnord "$@" --quiet
-         shift # fnord
-         ;;
-       esac
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
        set fnord "$@" "$arg"
-       shift # fnord
-       shift # "$arg"
-      done
-      ;;
+       shift
+       shift
+       ;;
     esac
-    "$@" -E |
-    sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u 
\\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
-  ) &
-  proc=$!
-  "$@"
-  stat=$?
-  wait "$proc"
-  if test "$stat" != 0; then exit $stat; fi
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' 
| sort | uniq > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
   . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::   \1 \\:p' >> 
"$depfile"
diff -pru .del/bison2/config/install-sh bison/config/install-sh
--- .del/bison2/config/install-sh       2002-06-14 10:35:45.000000000 -0700
+++ bison/config/install-sh     2002-08-12 07:01:45.000000000 -0700
@@ -109,7 +109,7 @@ then
        echo "install:  no input file specified"
        exit 1
 else
-       true
+       :
 fi
 
 if [ x"$dir_arg" != x ]; then
@@ -120,7 +120,7 @@ if [ x"$dir_arg" != x ]; then
                instcmd=:
                chmodcmd=""
        else
-               instcmd=mkdir
+               instcmd=$mkdirprog
        fi
 else
 
@@ -128,9 +128,9 @@ else
 # might cause directories to be created, which would be especially bad 
 # if $src (and thus $dsttmp) contains '*'.
 
-       if [ -f $src -o -d $src ]
+       if [ -f "$src" ] || [ -d "$src" ]
        then
-               true
+               :
        else
                echo "install:  $src does not exist"
                exit 1
@@ -141,7 +141,7 @@ else
                echo "install:  no destination specified"
                exit 1
        else
-               true
+               :
        fi
 
 # If destination is a directory, append the input filename; if your system
@@ -151,7 +151,7 @@ else
        then
                dst="$dst"/`basename $src`
        else
-               true
+               :
        fi
 fi
 
@@ -163,8 +163,8 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s
 
 # Skip lots of stat calls in the usual case.
 if [ ! -d "$dstdir" ]; then
-defaultIFS='   
-'
+defaultIFS='
+       '
 IFS="${IFS-${defaultIFS}}"
 
 oIFS="${IFS}"
@@ -183,7 +183,7 @@ while [ $# -ne 0 ] ; do
         then
                $mkdirprog "${pathcomp}"
        else
-               true
+               :
        fi
 
        pathcomp="${pathcomp}/"
@@ -194,10 +194,10 @@ if [ x"$dir_arg" != x ]
 then
        $doit $instcmd $dst &&
 
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
-       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
-       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
+       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
+       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
 else
 
 # If we're going to rename the final executable, determine the name now.
@@ -216,7 +216,7 @@ else
        then
                dstfile=`basename $dst`
        else
-               true
+               :
        fi
 
 # Make a temp file name in the proper directory.
@@ -235,10 +235,10 @@ else
 # ignore errors from any of these, just make sure not to ignore
 # errors from the above "$doit $instcmd $src $dsttmp" command.
 
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
-       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
-       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
+       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
+       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
 
 # Now rename the file to the real destination.
 
diff -pru .del/bison2/configure.in bison/configure.in
--- .del/bison2/configure.in    2002-07-31 12:52:13.000000000 -0700
+++ bison/configure.in  2002-08-12 07:00:04.000000000 -0700
@@ -92,7 +92,7 @@ AC_FUNC_ERROR_AT_LINE
 AC_FUNC_STRNLEN
 UTILS_FUNC_MKSTEMP
 AC_CHECK_FUNCS(setlocale)
-AC_CHECK_DECLS([free, stpcpy, strchr, strspn, strnlen,
+AC_CHECK_DECLS([getenv, getopt, free, stpcpy, strchr, strspn, strnlen,
                 malloc, memchr, memrchr])
 AC_REPLACE_FUNCS(stpcpy strchr strspn memchr memrchr)
 jm_FUNC_MALLOC
@@ -101,11 +101,10 @@ jm_PREREQ_QUOTEARG
 jm_PREREQ_ERROR
 AM_WITH_DMALLOC
 BISON_PREREQ_TIMEVAR
-BISON_PREREQ_STAGE
 
 # Gettext.
-GETTEXT_VERSION=0.11.2
-AM_GNU_GETTEXT(, need-ngettext)
+AM_GNU_GETTEXT(external, need-ngettext)
+AM_GNU_GETTEXT_VERSION(0.11.5)
 
 # This is necessary so that .o files in LIBOBJS are also built via
 # the ANSI2KNR-filtering rules.
@@ -114,7 +113,7 @@ AC_SUBST(LIB@&address@hidden)
 
 AC_OUTPUT([Makefile
            config/Makefile
-           intl/Makefile po/Makefile.in
+           po/Makefile.in
            data/Makefile
            lib/Makefile src/Makefile doc/Makefile
            m4/Makefile])
diff -pru .del/bison2/data/glr.c bison/data/glr.c
--- .del/bison2/data/glr.c      2002-07-30 04:56:44.000000000 -0700
+++ bison/data/glr.c    2002-08-12 07:02:32.000000000 -0700
@@ -108,11 +108,12 @@ b4_copyright([Skeleton parser for GLR pa
 /* This is the parser code for GLR (Generalized LR) parser. */
 
 /* FIXME: minimize these */
-#include <stdlib.h>
+#include <assert.h>
 #include <setjmp.h>
-#include <stdio.h>
 #include <stdarg.h>
-#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 /* Identify Bison output.  */
 #define YYBISON        1
@@ -1497,7 +1498,8 @@ yyreportParseError (yyGLRStack* yystack,
     {
 #if YYERROR_VERBOSE
       yySymbol* const yytokenp = yystack->yytokenp;
-      int yyn, yyx, yycount, yysize;
+      int yyn, yyx, yycount;
+      size_t yysize;
       const char* yyprefix;
       char* yyp;
       char* yymsg;
@@ -1761,20 +1763,19 @@ static void yypstack (yyGLRStack* yystac
 static void yypdumpstack (yyGLRStack* yystack) ATTRIBUTE_UNUSED;
 
 static void
-yypstates (yyGLRState* yyst)
+yy_yypstack (yyGLRState* yys)
 {
-  static void
-  yy_yypstack (yyGLRState* yys)
+  if (yys->yypred)
     {
-      if (yys->yypred == NULL)
-       fprintf (stderr, "address@hidden", yys->yylrState, yys->yyposn);
-      else
-       {
-         yy_yypstack (yys->yypred);
-         fprintf (stderr, " -> address@hidden", yys->yylrState, yys->yyposn);
-       }
+      yy_yypstack (yys->yypred);
+      fprintf (stderr, " -> ");
     }
+  fprintf (stderr, "address@hidden", yys->yylrState, (unsigned long) 
yys->yyposn);
+}
 
+static void
+yypstates (yyGLRState* yyst)
+{
   if (yyst == NULL)
     fprintf (stderr, "<null>");
   else
@@ -1799,28 +1800,30 @@ yypdumpstack (yyGLRStack* yystack)
   size_t yyi;
   for (yyp = yystack->yyitems; yyp < yystack->yynextFree; yyp += 1)
     {
-      fprintf (stderr, "%3d. ", yyp - yystack->yyitems);
+      fprintf (stderr, "%3lu. ", (unsigned long) (yyp - yystack->yyitems));
       if (*(bool*) yyp)
        {
-         fprintf (stderr, "Res: %d, LR State: %d, posn: %d, pred: %d",
+         fprintf (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
                   yyp->yystate.yyresolved, yyp->yystate.yylrState,
-                  yyp->yystate.yyposn,
-                  YYINDEX(yyp->yystate.yypred));
+                  (unsigned long) yyp->yystate.yyposn,
+                  (long) YYINDEX (yyp->yystate.yypred));
          if (! yyp->yystate.yyresolved)
-           fprintf (stderr, ", firstVal: %d",
-                    YYINDEX (yyp->yystate.yysemantics.yyfirstVal));
+           fprintf (stderr, ", firstVal: %ld",
+                    (long) YYINDEX (yyp->yystate.yysemantics.yyfirstVal));
        }
       else
        {
-         fprintf (stderr, "Option. rule: %d, state: %d, next: %d",
-                  yyp->yyoption.yyrule, YYINDEX (yyp->yyoption.yystate),
-                  YYINDEX (yyp->yyoption.yynext));
+         fprintf (stderr, "Option. rule: %d, state: %ld, next: %ld",
+                  yyp->yyoption.yyrule,
+                  (long) YYINDEX (yyp->yyoption.yystate),
+                  (long) YYINDEX (yyp->yyoption.yynext));
        }
       fprintf (stderr, "\n");
     }
   fprintf (stderr, "Tops:");
   for (yyi = 0; yyi < yystack->yytops.yysize; yyi += 1)
-    fprintf (stderr, "%d: %d; ", yyi, YYINDEX (yystack->yytops.yystates[yyi]));
+    fprintf (stderr, "%lu: %ld; ", (unsigned long) yyi,
+            (long) YYINDEX (yystack->yytops.yystates[yyi]));
   fprintf (stderr, "\n");
 }
 
diff -pru .del/bison2/data/yacc.c bison/data/yacc.c
--- .del/bison2/data/yacc.c     2002-07-30 04:56:44.000000000 -0700
+++ bison/data/yacc.c   2002-08-12 08:04:54.000000000 -0700
@@ -1044,8 +1044,8 @@ yyreduce:
   /* If YYLEN is nonzero, implement the default value of the action:
      `$$ = $1'.
 
-     Otherwise, the following line sets YYVAL to the semantic value of
-     the lookahead token.  This behavior is undocumented and Bison
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
      users should not rely upon it.  Assigning to YYVAL
      unconditionally makes the parser a bit smaller, and it avoids a
      GCC warning that YYVAL may be used uninitialized.  */
diff -pru .del/bison2/lib/abitset.c bison/lib/abitset.c
--- .del/bison2/lib/abitset.c   2002-07-02 06:51:26.000000000 -0700
+++ bison/lib/abitset.c 2002-08-12 07:09:24.000000000 -0700
@@ -208,8 +208,7 @@ abitset_reverse_list (src, list, num, ne
   bitcnt = bitno % BITSET_WORD_BITS;
   bitoff = windex * BITSET_WORD_BITS;
 
-  for (; windex != ~0U; windex--, bitoff -= BITSET_WORD_BITS,
-        bitcnt = BITSET_WORD_BITS - 1)
+  do
     {
       word = srcp[windex] << (BITSET_WORD_BITS - 1 - bitcnt);
       for (; word; bitcnt--)
@@ -225,7 +224,10 @@ abitset_reverse_list (src, list, num, ne
            }
          word <<= 1;
        }
+      bitoff -= BITSET_WORD_BITS;
+      bitcnt = BITSET_WORD_BITS - 1;
     }
+  while (windex--);
 
   *next = n_bits - (bitoff + 1);
   return count;
@@ -348,7 +350,7 @@ abitset_unused_clear (dst)
   last_bit = ABITSET_N_BITS (dst) % BITSET_WORD_BITS;
   if (last_bit)
     ABITSET_WORDS (dst)[dst->b.csize - 1] &=
-      (bitset_word) ((1 << last_bit) - 1);
+      ((bitset_word) 1 << last_bit) - 1;
 }
 
 
@@ -370,7 +372,7 @@ abitset_op1 (dst, op)
       break;
 
     case BITSET_OP_ONES:
-      memset (dstp, ~0, bytes);
+      memset (dstp, -1, bytes);
       abitset_unused_clear (dst);
       break;
 
diff -pru .del/bison2/lib/argmatch.c bison/lib/argmatch.c
--- .del/bison2/lib/argmatch.c  2002-05-26 23:18:41.000000000 -0700
+++ bison/lib/argmatch.c        2002-08-12 07:10:23.000000000 -0700
@@ -1,5 +1,5 @@
 /* argmatch.c -- find a match for a string in an array
-   Copyright (C) 1990, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1998, 1999, 2001 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
@@ -22,6 +22,7 @@
 
 #include <stdio.h>
 #ifdef STDC_HEADERS
+# include <stdlib.h>
 # include <string.h>
 #endif
 
@@ -38,6 +39,7 @@
 
 #include "error.h"
 #include "quotearg.h"
+#include "quote.h"
 
 /* When reporting an invalid argument, show nonprinting characters
    by using the quoting style ARGMATCH_QUOTING_STYLE.  Do not use
@@ -156,10 +158,11 @@ void
 argmatch_invalid (const char *context, const char *value, int problem)
 {
   char const *format = (problem == -1
-                       ? _("invalid argument %s for `%s'")
-                       : _("ambiguous argument %s for `%s'"));
+                       ? _("invalid argument %s for %s")
+                       : _("ambiguous argument %s for %s"));
 
-  error (0, 0, format, quotearg_style (ARGMATCH_QUOTING_STYLE, value), 
context);
+  error (0, 0, format, quotearg_n_style (0, ARGMATCH_QUOTING_STYLE, value),
+        quote_n (1, context));
 }
 
 /* List the valid arguments for argmatch.
diff -pru .del/bison2/lib/argmatch.h bison/lib/argmatch.h
--- .del/bison2/lib/argmatch.h  2002-05-26 23:18:41.000000000 -0700
+++ bison/lib/argmatch.h        2002-08-12 07:11:02.000000000 -0700
@@ -1,5 +1,5 @@
 /* argmatch.h -- definitions and prototypes for argmatch.c
-   Copyright (C) 1990, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1998, 1999, 2001 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
@@ -104,7 +104,7 @@ int __xargmatch_internal
 
 /* Programmer friendly interface to __xargmatch_internal. */
 
-# define XARGMATCH(Context, Arg, Arglist, Vallist)             \
+# define XARGMATCH(Context, Arg, Arglist, Vallist)                     \
   (Vallist [__xargmatch_internal ((Context), (Arg), (Arglist), \
                                   (const char *) (Vallist),    \
                                  sizeof (*(Vallist)),          \
@@ -123,7 +123,7 @@ const char *argmatch_to_argument
           const char *vallist, size_t valsize));
 
 # define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist)                 \
-  argmatch_to_argument ((char const *) &(Value), (Arglist),            \
+  argmatch_to_argument ((Value), (Arglist),            \
                        (const char *) (Vallist), sizeof (*(Vallist)))
 
 #endif /* ARGMATCH_H_ */
diff -pru .del/bison2/lib/basename.c bison/lib/basename.c
--- .del/bison2/lib/basename.c  2002-01-08 09:27:46.000000000 -0800
+++ bison/lib/basename.c        2002-08-12 07:11:02.000000000 -0700
@@ -19,53 +19,61 @@
 # include <config.h>
 #endif
 
-#include <stdio.h>
-#include <assert.h>
-
-#ifndef FILESYSTEM_PREFIX_LEN
-# define FILESYSTEM_PREFIX_LEN(Filename) 0
-#endif
-
-#ifndef PARAMS
-# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
-#  define PARAMS(Args) Args
-# else
-#  define PARAMS(Args) ()
-# endif
+#if STDC_HEADERS || HAVE_STRING_H
+# include <string.h>
 #endif
-
-#ifndef ISSLASH
-# define ISSLASH(C) ((C) == '/')
-#endif
-
-char *base_name PARAMS ((char const *name));
+#include "dirname.h"
 
 /* In general, we can't use the builtin `basename' function if available,
    since it has different meanings in different environments.
    In some environments the builtin `basename' modifies its argument.
-   If NAME is all slashes, be sure to return `/'.  */
+
+   Return the address of the last file name component of NAME.  If
+   NAME has no file name components because it is all slashes, return
+   NAME if it is empty, the address of its last slash otherwise.  */
 
 char *
 base_name (char const *name)
 {
-  char const *base = name += FILESYSTEM_PREFIX_LEN (name);
-  int all_slashes = 1;
+  char const *base = name + FILESYSTEM_PREFIX_LEN (name);
   char const *p;
 
-  for (p = name; *p; p++)
+  for (p = base; *p; p++)
     {
       if (ISSLASH (*p))
-       base = p + 1;
-      else
-       all_slashes = 0;
+       {
+         /* Treat multiple adjacent slashes like a single slash.  */
+         do p++;
+         while (ISSLASH (*p));
+
+         /* If the file name ends in slash, use the trailing slash as
+            the basename if no non-slashes have been found.  */
+         if (! *p)
+           {
+             if (ISSLASH (*base))
+               base = p - 1;
+             break;
+           }
+
+         /* *P is a non-slash preceded by a slash.  */
+         base = p;
+       }
     }
 
-  /* If NAME is all slashes, arrange to return `/'.  */
-  if (*base == '\0' && ISSLASH (*name) && all_slashes)
-    --base;
+  return (char *) base;
+}
 
-  /* Make sure the last byte is not a slash.  */
-  assert (all_slashes || !ISSLASH (*(p - 1)));
+/* Return the length of of the basename NAME.  Typically NAME is the
+   value returned by base_name.  Act like strlen (NAME), except omit
+   redundant trailing slashes.  */
 
-  return (char *) base;
+size_t
+base_len (char const *name)
+{
+  size_t len;
+
+  for (len = strlen (name);  1 < len && ISSLASH (name[len - 1]);  len--)
+    continue;
+
+  return len;
 }
diff -pru .del/bison2/lib/bbitset.h bison/lib/bbitset.h
--- .del/bison2/lib/bbitset.h   2002-07-02 06:51:26.000000000 -0700
+++ bison/lib/bbitset.h 2002-08-12 07:13:56.000000000 -0700
@@ -45,17 +45,19 @@ enum bitset_alloc_type {BITSET_MALLOC, B
 
 /* Data type used to store a word of bits.  */
 typedef unsigned long bitset_word;
-#define BITSET_WORD_BITS ((unsigned) CHAR_BIT * sizeof (bitset_word))
+#define BITSET_WORD_BITS ((unsigned) (CHAR_BIT * sizeof (bitset_word)))
 
-/* Bit index.  */
-typedef unsigned long bitset_bindex;
+/* Bit index.  In theory we might need a type wider than size_t, but
+   in practice we lose at most a factor of CHAR_BIT by going with
+   size_t, and that is good enough.  */
+typedef size_t bitset_bindex;
 
 /* Word index.  */
-typedef unsigned long bitset_windex;
+typedef size_t bitset_windex;
 
-#define BITSET_INDEX_MAX ((1U << (BITSET_WORD_BITS - 1)))
+#define BITSET_INDEX_MAX ((bitset_word) 1 << (BITSET_WORD_BITS - 1))
 
-#define BITSET_MSB (1U << (BITSET_WORD_BITS - 1))
+#define BITSET_MSB ((bitset_word) 1 << (BITSET_WORD_BITS - 1))
 
 #define BITSET_LIST_SIZE 1024
 
diff -pru .del/bison2/lib/bitset.h bison/lib/bitset.h
--- .del/bison2/lib/bitset.h    2002-07-02 06:51:26.000000000 -0700
+++ bison/lib/bitset.h  2002-08-12 07:19:02.000000000 -0700
@@ -107,7 +107,7 @@ static inline void bitset_set (bset, bit
   bitset_windex offset = index - bset->b.cindex;
   
   if (offset < bset->b.csize)
-    bset->b.cdata[offset] |= (1 << (bitno % BITSET_WORD_BITS));
+    bset->b.cdata[offset] |= ((bitset_word) 1 << (bitno % BITSET_WORD_BITS));
   else
     BITSET_SET_ (bset, bitno);
 }
@@ -122,7 +122,7 @@ static inline void bitset_reset (bset, b
   bitset_windex offset = index - bset->b.cindex;
   
   if (offset < bset->b.csize)
-    bset->b.cdata[offset] &= ~(1 << (bitno % BITSET_WORD_BITS));
+    bset->b.cdata[offset] &= ~((bitset_word) 1 << (bitno % BITSET_WORD_BITS));
   else
     BITSET_RESET_ (bset, bitno);
 }
@@ -154,7 +154,8 @@ do                                                          
        \
   bitset_windex _offset = _index - (bset)->b.cindex;           \
                                                                \
   if (_offset < (bset)->b.csize)                                       \
-    (bset)->b.cdata[_offset] |= (1 << (_bitno % BITSET_WORD_BITS));    \
+    (bset)->b.cdata[_offset] |=                                        \
+      ((bitset_word) 1 << (_bitno % BITSET_WORD_BITS));        \
   else                                                         \
     BITSET_SET_ ((bset), _bitno);                              \
 } while (0)
@@ -169,7 +170,8 @@ do                                                          
        \
   bitset_windex _offset = _index - (bset)->b.cindex;           \
                                                                \
   if (_offset < (bset)->b.csize)                                       \
-    (bset)->b.cdata[_offset] &= ~(1 << (_bitno % BITSET_WORD_BITS));   \
+    (bset)->b.cdata[_offset] &=                                        \
+      ~((bitset_word) 1 << (_bitno % BITSET_WORD_BITS));       \
   else                                                         \
     BITSET_RESET_ ((bset), _bitno);                            \
 } while (0)
@@ -178,9 +180,11 @@ do                                                         
        \
 /* Test bit BITNO in bitset BSET.  */
 #define bitset_test(bset, bitno) \
 (((((bitno) / BITSET_WORD_BITS) - (bset)->b.cindex) < (bset)->b.csize) \
-  ? ((bset)->b.cdata[(((bitno) / BITSET_WORD_BITS) - (bset)->b.cindex)] \
-     >> ((bitno) % BITSET_WORD_BITS)) & 1 \
-  : (unsigned int) BITSET_TEST_ ((bset), (bitno)))
+  ? (((int)                                                    \
+      ((bset)->b.cdata[(((bitno) / BITSET_WORD_BITS) - (bset)->b.cindex)] \
+       >> ((bitno) % BITSET_WORD_BITS)))                       \
+     & 1)                                                      \
+  : BITSET_TEST_ ((bset), (bitno)))
 #endif
 
 
diff -pru .del/bison2/lib/bitset_stats.c bison/lib/bitset_stats.c
--- .del/bison2/lib/bitset_stats.c      2002-07-02 06:51:26.000000000 -0700
+++ bison/lib/bitset_stats.c    2002-08-12 07:16:49.000000000 -0700
@@ -38,6 +38,8 @@
 #include <string.h>
 #include <stdio.h>
 
+#include "gettext.h"
+#define _(Msgid)  gettext (Msgid)
 
 /* Configuration macros.  */
 #define BITSET_STATS_FILE "bitset.dat"
@@ -221,28 +223,28 @@ bitset_stats_print_1 (file, name, stats)
     return;
   
   fprintf (file, "%s:\n", name);
-  fprintf (file, "%d bitset_allocs, %d freed (%.2f%%).\n",
+  fprintf (file, _("%d bitset_allocs, %d freed (%.2f%%).\n"),
           stats->allocs, stats->frees,
           stats->allocs ? 100.0 * stats->frees / stats->allocs : 0);
-  fprintf (file, "%d bitset_sets, %d cached (%.2f%%)\n",
+  fprintf (file, _("%d bitset_sets, %d cached (%.2f%%)\n"),
           stats->sets, stats->cache_sets,
           stats->sets ? 100.0 * stats->cache_sets / stats->sets : 0);
-  fprintf (file, "%d bitset_resets, %d cached (%.2f%%)\n",
+  fprintf (file, _("%d bitset_resets, %d cached (%.2f%%)\n"),
           stats->resets, stats->cache_resets,
           stats->resets ? 100.0 * stats->cache_resets / stats->resets : 0);
-  fprintf (file, "%d bitset_tests, %d cached (%.2f%%)\n",
+  fprintf (file, _("%d bitset_tests, %d cached (%.2f%%)\n"),
           stats->tests, stats->cache_tests,
           stats->tests ? 100.0 * stats->cache_tests / stats->tests : 0);
 
-  fprintf (file, "%d bitset_lists\n", stats->lists);
+  fprintf (file, _("%d bitset_lists\n"), stats->lists);
 
-  bitset_log_histogram_print (file, name, "count log histogram\n",
+  bitset_log_histogram_print (file, name, _("count log histogram\n"),
                              BITSET_LOG_COUNT_BINS, stats->list_counts);
 
-  bitset_log_histogram_print (file, name, "size log histogram\n",
+  bitset_log_histogram_print (file, name, _("size log histogram\n"),
                              BITSET_LOG_SIZE_BINS, stats->list_sizes);
 
-  bitset_percent_histogram_print (file, name, "density histogram\n",
+  bitset_percent_histogram_print (file, name, _("density histogram\n"),
                                  BITSET_DENSITY_BINS, stats->list_density);
 }
 
@@ -259,10 +261,10 @@ bitset_stats_print (file, verbose)
   if (!bitset_stats_info)
     return;
 
-  fprintf (file, "Bitset statistics:\n\n");
+  fprintf (file, _("Bitset statistics:\n\n"));
 
   if (bitset_stats_info->runs > 1)
-    fprintf (file, "Accumulated runs = %d\n", bitset_stats_info->runs);
+    fprintf (file, _("Accumulated runs = %d\n"), bitset_stats_info->runs);
 
   for (i = 0; i < BITSET_TYPE_NUM; i++)
     bitset_stats_print_1 (file, names[i], &bitset_stats_info->types[i]);
@@ -306,9 +308,9 @@ bitset_stats_read (filename)
                 1, file) != 1)
        {
          if (ferror (file))
-           perror ("Could not read stats file.");
+           perror (_("Could not read stats file."));
          else
-           fprintf (stderr, "Bad stats file size.\n");
+           fprintf (stderr, _("Bad stats file size.\n"));
        }
       fclose (file);
     }
@@ -334,11 +336,11 @@ bitset_stats_write (filename)
     {
       if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
                  1, file) != 1)
-       perror ("Could not write stats file.");
+       perror (_("Could not write stats file."));
       fclose (file);
     }
   else
-    perror ("Could not open stats file for writing.");
+    perror (_("Could not open stats file for writing."));
 }
 
 
@@ -365,14 +367,14 @@ bitset_stats_set (dst, bitno)
      bitset_bindex bitno;
 {
   bitset bset = dst->s.bset;
-  bitset_windex index = bitno / BITSET_WORD_BITS;
-  bitset_windex offset = index - bset->b.cindex;
+  bitset_windex wordno = bitno / BITSET_WORD_BITS;
+  bitset_windex offset = wordno - bset->b.cindex;
   
   BITSET_STATS_SETS_INC (bset);
 
   if (offset < bset->b.csize)
     {
-      bset->b.cdata[offset] |= (1 << (bitno % BITSET_WORD_BITS));
+      bset->b.cdata[offset] |= (bitset_word) 1 << (bitno % BITSET_WORD_BITS);
       BITSET_STATS_CACHE_SETS_INC (bset);
     }
   else
@@ -386,14 +388,15 @@ bitset_stats_reset (dst, bitno)
      bitset_bindex bitno;
 {
   bitset bset = dst->s.bset;
-  bitset_windex index = bitno / BITSET_WORD_BITS;
-  bitset_windex offset = index - bset->b.cindex;
+  bitset_windex wordno = bitno / BITSET_WORD_BITS;
+  bitset_windex offset = wordno - bset->b.cindex;
   
   BITSET_STATS_RESETS_INC (bset);
 
   if (offset < bset->b.csize)
     {
-      bset->b.cdata[offset] &= ~(1 << (bitno % BITSET_WORD_BITS));
+      bset->b.cdata[offset] &=
+       ~((bitset_word) 1 << (bitno % BITSET_WORD_BITS));
       BITSET_STATS_CACHE_RESETS_INC (bset);
     }
   else
@@ -407,8 +410,8 @@ bitset_stats_test (src, bitno)
      bitset_bindex bitno;
 {
   bitset bset = src->s.bset;
-  bitset_windex index = bitno / BITSET_WORD_BITS;
-  bitset_windex offset = index - bset->b.cindex;
+  bitset_windex wordno = bitno / BITSET_WORD_BITS;
+  bitset_windex offset = wordno - bset->b.cindex;
 
   BITSET_STATS_TESTS_INC (bset);
   
diff -pru .del/bison2/lib/dirname.c bison/lib/dirname.c
--- .del/bison2/lib/dirname.c   2002-01-08 09:27:46.000000000 -0800
+++ bison/lib/dirname.c 2002-08-12 07:11:02.000000000 -0700
@@ -1,5 +1,5 @@
 /* dirname.c -- return all but the last element in a path
-   Copyright (C) 1990, 1998, 2000 Free Software Foundation, Inc.
+   Copyright 1990, 1998, 2000, 2001 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
@@ -19,126 +19,43 @@
 # include <config.h>
 #endif
 
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#else
-char *malloc ();
-#endif
-#if defined STDC_HEADERS || defined HAVE_STRING_H
+#if STDC_HEADERS || HAVE_STRING_H
 # include <string.h>
-#else
-# include <strings.h>
-# ifndef strrchr
-#  define strrchr rindex
-# endif
-#endif
-#include <assert.h>
-
-#ifndef HAVE_DECL_MEMRCHR
-"this configure-time declaration test was not run"
-#endif
-#if !HAVE_DECL_MEMRCHR
-void *memrchr ();
 #endif
 
 #include "dirname.h"
+#include "xalloc.h"
 
-#ifndef FILESYSTEM_PREFIX_LEN
-# define FILESYSTEM_PREFIX_LEN(Filename) 0
-#endif
-
-#ifndef ISSLASH
-# define ISSLASH(C) ((C) == '/')
-#endif
-
-#define BACKSLASH_IS_PATH_SEPARATOR ISSLASH ('\\')
-
-/* Return the length of `dirname (PATH)' and set *RESULT to point
-   to PATH or to `"."', as appropriate.  Works properly even if
-   there are trailing slashes (by effectively ignoring them).
-   WARNING: This function doesn't work for cwd-relative names like
-   `a:foo' that are specified with a drive-letter prefix.  That case
-   is handled in the caller.  */
-static size_t
-dir_name_r (char const *path, char const **result)
+/* Return the length of `dirname (PATH)', or zero if PATH is
+   in the working directory.  Works properly even if
+   there are trailing slashes (by effectively ignoring them).  */
+size_t
+dir_len (char const *path)
 {
-  char const *slash;
-  size_t length;               /* Length of result, not including NUL.  */
-
-  slash = strrchr (path, '/');
-  if (BACKSLASH_IS_PATH_SEPARATOR)
-    {
-      char const *b = strrchr (path, '\\');
-      if (b && slash < b)
-       slash = b;
-    }
+  size_t prefix_length = FILESYSTEM_PREFIX_LEN (path);
+  size_t length;
 
-  /* If the last byte of PATH is a slash, decrement SLASH until it's
-     pointing at the leftmost in a sequence of trailing slashes.  */
-  if (slash && slash[1] == 0)
-    {
-      while (path < slash && ISSLASH (slash[-1]))
-       {
-         --slash;
-       }
-
-      if (path < slash)
-       {
-         size_t len = slash - path;
-         slash = memrchr (path, '/', len);
-         if (BACKSLASH_IS_PATH_SEPARATOR)
-           {
-             char const *b = memrchr (path, '\\', len);
-             if (b && slash < b)
-               slash = b;
-           }
-       }
-    }
-
-  if (slash == 0)
-    {
-      /* File is in the current directory.  */
-
-      length = FILESYSTEM_PREFIX_LEN (path);
-
-      if (length == 0)
-       {
-         path = ".";
-         length = 1;
-       }
-    }
-  else
-    {
-      /* Remove any trailing slashes from the result.  If we have a
-        canonicalized "d:/path", leave alone the root case "d:/".  */
-      char const *lim = path + FILESYSTEM_PREFIX_LEN (path);
-
-      while (lim < slash && ISSLASH (*slash))
-       --slash;
+  /* Strip the basename and any redundant slashes before it.  */
+  for (length = base_name (path) - path;  prefix_length < length;  length--)
+    if (! ISSLASH (path[length - 1]))
+      return length;
 
-      length = slash - path + 1;
-    }
-
-  *result = path;
-  return length;
+  /* But don't strip the only slash from "/".  */
+  return prefix_length + ISSLASH (path[prefix_length]);
 }
 
 /* Return the leading directories part of PATH,
-   allocated with malloc.  If out of memory, return 0.
+   allocated with xmalloc.
    Works properly even if there are trailing slashes
    (by effectively ignoring them).  */
 
 char *
 dir_name (char const *path)
 {
-  char const *result;
-  size_t length = dir_name_r (path, &result);
-  int append_dot = (length && length == FILESYSTEM_PREFIX_LEN (newpath));
-  char *newpath = (char *) malloc (length + append_dot + 1);
-  if (newpath == 0)
-    return 0;
-  strncpy (newpath, result, length);
-  /* If PATH is "d:foo", return "d:.", the CWD on drive d:  */
+  size_t length = dir_len (path);
+  int append_dot = (length == FILESYSTEM_PREFIX_LEN (path));
+  char *newpath = xmalloc (length + append_dot + 1);
+  memcpy (newpath, path, length);
   if (append_dot)
     newpath[length++] = '.';
   newpath[length] = 0;
@@ -149,7 +66,8 @@ dir_name (char const *path)
 /*
 
 Run the test like this (expect no output):
-  gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall memrchr.c dirname.c
+  gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall \
+     basename.c dirname.c xmalloc.c
   sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out
 
 BEGIN-DATA
@@ -165,7 +83,6 @@ END-DATA
 
 # define MAX_BUFF_LEN 1024
 # include <stdio.h>
-# include <stdlib.h>
 
 int
 main ()
@@ -183,7 +100,6 @@ main ()
       if (strcmp (result, expected_result))
        printf ("%s: got %s, expected %s\n", path, result, expected_result);
     }
-  exit (0);
-
+  return 0;
 }
 #endif
diff -pru .del/bison2/lib/dirname.h bison/lib/dirname.h
--- .del/bison2/lib/dirname.h   2002-01-08 09:27:46.000000000 -0800
+++ bison/lib/dirname.h 2002-08-12 07:11:02.000000000 -0700
@@ -1,4 +1,4 @@
-/*  Copyright (C) 1998 Free Software Foundation, Inc.
+/*  Copyright (C) 1998, 2001 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
@@ -25,7 +25,23 @@
 #  endif
 # endif
 
-char *
-dir_name PARAMS ((const char *path));
+# ifndef DIRECTORY_SEPARATOR
+#  define DIRECTORY_SEPARATOR '/'
+# endif
+
+# ifndef ISSLASH
+#  define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
+# endif
+
+# ifndef FILESYSTEM_PREFIX_LEN
+#  define FILESYSTEM_PREFIX_LEN(Filename) 0
+# endif
+
+char *base_name PARAMS ((char const *path));
+char *dir_name PARAMS ((char const *path));
+size_t base_len PARAMS ((char const *path));
+size_t dir_len PARAMS ((char const *path));
+
+int strip_trailing_slashes PARAMS ((char *path));
 
 #endif /* not DIRNAME_H_ */
diff -pru .del/bison2/lib/ebitset.c bison/lib/ebitset.c
--- .del/bison2/lib/ebitset.c   2002-07-02 06:51:26.000000000 -0700
+++ bison/lib/ebitset.c 2002-08-12 07:20:35.000000000 -0700
@@ -578,7 +578,8 @@ ebitset_set (dst, bitno)
 
   ebitset_elt_find (dst, windex, EBITSET_CREATE);
 
-  dst->b.cdata[windex - dst->b.cindex] |= (1 << (bitno % BITSET_WORD_BITS));
+  dst->b.cdata[windex - dst->b.cindex] |=
+    (bitset_word) 1 << (bitno % BITSET_WORD_BITS);
 }
 
 
@@ -593,7 +594,8 @@ ebitset_reset (dst, bitno)
   if (!ebitset_elt_find (dst, windex, EBITSET_FIND))
     return;
 
-  dst->b.cdata[windex - dst->b.cindex] &= ~(1 << (bitno % BITSET_WORD_BITS));
+  dst->b.cdata[windex - dst->b.cindex] &=
+    ~((bitset_word) 1 << (bitno % BITSET_WORD_BITS));
 
   /* If all the data is zero, perhaps we should remove it now... 
      However, there is a good chance that the element will be needed
@@ -646,7 +648,6 @@ ebitset_reverse_list (bset, list, num, n
   bitset_windex woffset;
   bitset_bindex count;
   bitset_windex size;
-  bitset_word word;
   ebitset_elts *elts;
 
   if (EBITSET_OP_ZERO_P (bset))
@@ -674,40 +675,48 @@ ebitset_reverse_list (bset, list, num, n
   bcount = bitno % BITSET_WORD_BITS;
   boffset = windex * BITSET_WORD_BITS;
 
-  for (; eindex != ~0U; 
-       boffset = eindex * EBITSET_ELT_BITS - BITSET_WORD_BITS, eindex--) 
+  do
     {
       ebitset_elt *elt;
-      bitset_word *srcp;
 
       elt = elts[eindex];
-      if (!elt)
-       continue;
-
-      srcp = EBITSET_WORDS (elt);
-
-      for (; woffset != ~0U; woffset--, boffset -= BITSET_WORD_BITS,
-            bcount = BITSET_WORD_BITS - 1)
+      if (elt)
        {
-         word = srcp[woffset] << (BITSET_WORD_BITS - 1 - bcount);
+         bitset_word *srcp;
+
+         srcp = EBITSET_WORDS (elt);
 
-         for (; word; bcount--)
+         do
            {
-             if (word & BITSET_MSB)
+             bitset_word word;
+
+             word = srcp[woffset] << (BITSET_WORD_BITS - 1 - bcount);
+
+             for (; word; bcount--)
                {
-                 list[count++] = boffset + bcount;
-                 if (count >= num)
+                 if (word & BITSET_MSB)
                    {
-                     *next = n_bits - (boffset + bcount);
-                     return count;
+                     list[count++] = boffset + bcount;
+                     if (count >= num)
+                       {
+                         *next = n_bits - (boffset + bcount);
+                         return count;
+                       }
                    }
+                 word <<= 1;
                }
-             word <<= 1;
+
+             boffset -= BITSET_WORD_BITS;
+             bcount = BITSET_WORD_BITS - 1;
            }
+         while (woffset--);
+
+         woffset = EBITSET_ELT_WORDS;
        }
 
-      woffset = EBITSET_ELT_WORDS;
+      boffset = eindex * EBITSET_ELT_BITS - BITSET_WORD_BITS;
     }
+  while (eindex--);
 
   *next = n_bits - (boffset + 1);
   return count;
@@ -878,7 +887,7 @@ ebitset_op1 (dst, op)
             we should just add pointers to a ones element.  */
          elt =
            ebitset_elt_find (dst, j * EBITSET_ELT_WORDS, EBITSET_CREATE);
-         memset (EBITSET_WORDS (elt), ~0, sizeof (EBITSET_WORDS (elt)));
+         memset (EBITSET_WORDS (elt), -1, sizeof (EBITSET_WORDS (elt)));
        }
       break;
 
diff -pru .del/bison2/lib/error.c bison/lib/error.c
--- .del/bison2/lib/error.c     2001-10-26 00:26:00.000000000 -0700
+++ bison/lib/error.c   2002-08-12 07:11:35.000000000 -0700
@@ -3,20 +3,19 @@
    This file is part of the GNU C Library.  Its master source is NOT part of
    the C library, however.  The master source lives in /gd/gnu/lib.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
-   The GNU C Library is distributed in the hope that it will be useful,
+   This program 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
-   Lesser General Public License for more details.
+   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 Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Written by David MacKenzie <address@hidden>.  */
 
@@ -54,6 +53,7 @@ void exit ();
 #endif
 
 #include "error.h"
+#include "unlocked-io.h"
 
 #ifndef _
 # define _(String) String
diff -pru .del/bison2/lib/getopt1.c bison/lib/getopt1.c
--- .del/bison2/lib/getopt1.c   2001-10-26 00:26:00.000000000 -0700
+++ bison/lib/getopt1.c 2002-08-12 07:11:35.000000000 -0700
@@ -1,37 +1,27 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
+   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98, 2002
      Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
-   The GNU C Library is distributed in the hope that it will be useful,
+   This program 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
-   Lesser General Public License for more details.
+   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 Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
 #include "getopt.h"
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
-   reject `defined (const)'.  */
-#ifndef const
-#define const
-#endif
-#endif
-
 #include <stdio.h>
 
 /* Comment out all this code if we are using the GNU C Library, and are not
diff -pru .del/bison2/lib/getopt.c bison/lib/getopt.c
--- .del/bison2/lib/getopt.c    2001-10-26 00:26:00.000000000 -0700
+++ bison/lib/getopt.c  2002-08-12 07:11:35.000000000 -0700
@@ -2,24 +2,23 @@
    NOTE: getopt is now part of the C library, so if you don't know what
    "Keep this file name-space clean" means, talk to address@hidden
    before changing it!
-   Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001
+   Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002
        Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
-   The GNU C Library is distributed in the hope that it will be useful,
+   This program 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
-   Lesser General Public License for more details.
+   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 Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
    Ditto for AIX 3.2 and <stdlib.h>.  */
@@ -31,14 +30,6 @@
 # include <config.h>
 #endif
 
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
-   reject `defined (const)'.  */
-# ifndef const
-#  define const
-# endif
-#endif
-
 #include <stdio.h>
 
 /* Comment out all this code if we are using the GNU C Library, and are not
@@ -60,14 +51,12 @@
 #ifndef ELIDE_CODE
 
 
-/* This needs to come after some library #include
-   to get __GNU_LIBRARY__ defined.  */
-#ifdef __GNU_LIBRARY__
-/* Don't include stdlib.h for non-GNU C libraries because some of them
-   contain conflicting prototypes for getopt.  */
+#if HAVE_STDLIB_H || defined __GNU_LIBRARY__
 # include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H || defined __GNU_LIBRARY__
 # include <unistd.h>
-#endif /* GNU C library.  */
+#endif
 
 #ifdef VMS
 # include <unixlib.h>
@@ -190,30 +179,18 @@ static enum
 /* Value of POSIXLY_CORRECT environment variable.  */
 static char *posixly_correct;
 
-#ifdef __GNU_LIBRARY__
-/* We want to avoid inclusion of string.h with non-GNU libraries
-   because there are many ways it can cause trouble.
-   On some systems, it contains special magic macros that don't work
-   in GCC.  */
+#if HAVE_STRING_H || defined __GNU_LIBRARY__
 # include <string.h>
-# define my_index      strchr
 #else
-
-# if HAVE_STRING_H
-#  include <string.h>
-# else
+# if HAVE_STRINGS_H
 #  include <strings.h>
 # endif
-
-/* Avoid depending on library functions or files
-   whose names are inconsistent.  */
-
-#ifndef getenv
-extern char *getenv ();
 #endif
 
+#if !HAVE_STRCHR && !defined strchr && !defined __GNU_LIBRARY__
+# define strchr my_strchr
 static char *
-my_index (str, chr)
+strchr (str, chr)
      const char *str;
      int chr;
 {
@@ -225,20 +202,11 @@ my_index (str, chr)
     }
   return 0;
 }
+#endif
 
-/* If using GCC, we can safely declare strlen this way.
-   If not using GCC, it is ok not to declare it.  */
-#ifdef __GNUC__
-/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
-   That was relevant to code that was here before.  */
-# if (!defined __STDC__ || !__STDC__) && !defined strlen
-/* gcc with -traditional declares the built-in strlen to return int,
-   and has done so at least since version 2.4.5. -- rms.  */
-extern int strlen (const char *);
-# endif /* not __STDC__ */
-#endif /* __GNUC__ */
-
-#endif /* not __GNU_LIBRARY__ */
+#if !HAVE_DECL_GETENV && !defined getenv && !defined __GNU_LIBRARY__
+char *getenv ();
+#endif
 
 /* Handle permutation of arguments.  */
 
@@ -647,7 +615,7 @@ _getopt_internal (argc, argv, optstring,
 
   if (longopts != NULL
       && (argv[optind][1] == '-'
-         || (long_only && (argv[optind][2] || !my_index (optstring, 
argv[optind][1])))))
+         || (long_only && (argv[optind][2] || !strchr (optstring, 
argv[optind][1])))))
     {
       char *nameend;
       const struct option *p;
@@ -762,7 +730,7 @@ _getopt_internal (argc, argv, optstring,
         option, then it's an error.
         Otherwise interpret it as a short option.  */
       if (!long_only || argv[optind][1] == '-'
-         || my_index (optstring, *nextchar) == NULL)
+         || strchr (optstring, *nextchar) == NULL)
        {
          if (print_errors)
            {
@@ -786,7 +754,7 @@ _getopt_internal (argc, argv, optstring,
 
   {
     char c = *nextchar++;
-    char *temp = my_index (optstring, c);
+    char *temp = strchr (optstring, c);
 
     /* Increment `optind' when we start to process its last character.  */
     if (*nextchar == '\0')
diff -pru .del/bison2/lib/getopt.h bison/lib/getopt.h
--- .del/bison2/lib/getopt.h    2001-10-26 00:26:00.000000000 -0700
+++ bison/lib/getopt.h  2002-08-12 07:11:35.000000000 -0700
@@ -1,21 +1,23 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.
+
+   Copyright (C) 1989-1994, 1996-1999, 2001, 2002 Free Software Foundation,
+   Inc.
+
    This file is part of the GNU C Library.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
-   The GNU C Library is distributed in the hope that it will be useful,
+   This program 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
-   Lesser General Public License for more details.
+   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 Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifndef _GETOPT_H
 
@@ -27,11 +29,16 @@
    standalone, or this is the first header included in the source file.
    If we are being used with glibc, we need to include <features.h>, but
    that does not exist if we are standalone.  So: if __GNU_LIBRARY__ is
-   not defined, include <ctype.h>, which will pull in <features.h> for us
-   if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it
+   not defined, include <stdlib.h>, which will pull in <features.h> for us
+   if it's from glibc (and will declare getopt).  Fall back on <ctype.h> if
+   <stdlib.h> might not exist.  (Why ctype.h?  It's guaranteed to exist and it
    doesn't flood the namespace with stuff the way some other headers do.)  */
 #if !defined __GNU_LIBRARY__
-# include <ctype.h>
+# if HAVE_STDLIB_H || STDC_HEADERS
+#  include <stdlib.h>
+# else
+#  include <ctype.h>
+# endif
 #endif
 
 #ifdef __cplusplus
@@ -138,14 +145,16 @@ struct option
    `getopt'.  */
 
 #if (defined __STDC__ && __STDC__) || defined __cplusplus
-# ifdef __GNU_LIBRARY__
+# if defined HAVE_DECL_GETOPT && !HAVE_DECL_GETOPT
+#  ifdef __GNU_LIBRARY__
 /* Many other libraries have conflicting prototypes for getopt, with
    differences in the consts, in stdlib.h.  To avoid compilation
    errors, only prototype getopt for the GNU C library.  */
 extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
-# else /* not __GNU_LIBRARY__ */
+#  else /* not __GNU_LIBRARY__ */
 extern int getopt ();
-# endif /* __GNU_LIBRARY__ */
+#  endif /* __GNU_LIBRARY__ */
+# endif /* defined HAVE_DECL_GETOPT && !HAVE_DECL_GETOPT */
 
 # ifndef __need_getopt
 extern int getopt_long (int __argc, char *const *__argv, const char 
*__shortopts,
diff -pru .del/bison2/lib/gettext.h bison/lib/gettext.h
--- .del/bison2/lib/gettext.h   2002-03-14 10:31:14.000000000 -0800
+++ bison/lib/gettext.h 2002-08-12 07:11:35.000000000 -0700
@@ -1,20 +1,19 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
    Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU Library General Public License as published
-   by the Free Software Foundation; either version 2, or (at your option)
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
    any later version.
 
    This program 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
-   Library General Public License for more details.
+   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 Library General Public
-   License along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-   USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifndef _LIBGETTEXT_H
 #define _LIBGETTEXT_H 1
@@ -27,6 +26,16 @@
 
 #else
 
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+   chokes if dcgettext is defined as a macro.  So include it now, to make
+   later inclusions of <locale.h> a NOP.  We don't include <libintl.h>
+   as well because people using "gettext.h" will not include <libintl.h>,
+   and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+   is OK.  */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
 /* Disabled NLS.
    The casts to 'const char *' serve the purpose of producing warnings
    for invalid uses of the value returned from these functions.
diff -pru .del/bison2/lib/hash.c bison/lib/hash.c
--- .del/bison2/lib/hash.c      2002-02-05 02:00:47.000000000 -0800
+++ bison/lib/hash.c    2002-08-12 07:11:02.000000000 -0700
@@ -36,14 +36,14 @@ typedef enum {false = 0, true = 1} bool;
 #include <assert.h>
 
 #ifndef HAVE_DECL_FREE
-# error "this configure-time declaration test was not run"
+"this configure-time declaration test was not run"
 #endif
 #if !HAVE_DECL_FREE
 void free ();
 #endif
 
 #ifndef HAVE_DECL_MALLOC
-# error "this configure-time declaration test was not run"
+"this configure-time declaration test was not run"
 #endif
 #if !HAVE_DECL_MALLOC
 char *malloc ();
@@ -61,6 +61,40 @@ char *malloc ();
 
 #include "hash.h"
 
+struct hash_table
+  {
+    /* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
+       for a possibility of N_BUCKETS.  Among those, N_BUCKETS_USED buckets
+       are not empty, there are N_ENTRIES active entries in the table.  */
+    struct hash_entry *bucket;
+    struct hash_entry *bucket_limit;
+    unsigned n_buckets;
+    unsigned n_buckets_used;
+    unsigned n_entries;
+
+    /* Tuning arguments, kept in a physicaly separate structure.  */
+    const Hash_tuning *tuning;
+
+    /* Three functions are given to `hash_initialize', see the documentation
+       block for this function.  In a word, HASHER randomizes a user entry
+       into a number up from 0 up to some maximum minus 1; COMPARATOR returns
+       true if two user entries compare equally; and DATA_FREER is the cleanup
+       function for a user entry.  */
+    Hash_hasher hasher;
+    Hash_comparator comparator;
+    Hash_data_freer data_freer;
+
+    /* A linked list of freed struct hash_entry structs.  */
+    struct hash_entry *free_entry_list;
+
+#if USE_OBSTACK
+    /* Whenever obstacks are used, it is possible to allocate all overflowed
+       entries into a single stack, so they all can be freed in a single
+       operation.  It is not clear if the speedup is worth the trouble.  */
+    struct obstack entry_stack;
+#endif
+  };
+
 /* A hash table contains many internal entries, each holding a pointer to
    some user provided data (also called a user entry).  An entry indistinctly
    refers to both the internal entry and its associated user entry.  A user
@@ -576,19 +610,22 @@ void
 hash_clear (Hash_table *table)
 {
   struct hash_entry *bucket;
-  struct hash_entry *cursor;
 
   for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
     {
       if (bucket->data)
        {
+         struct hash_entry *cursor;
+         struct hash_entry *next;
+
          /* Free the bucket overflow.  */
-         for (cursor = bucket->next; cursor; cursor = cursor->next)
+         for (cursor = bucket->next; cursor; cursor = next)
            {
              if (table->data_freer)
                (*table->data_freer) (cursor->data);
              cursor->data = NULL;
 
+             next = cursor->next;
              /* Relinking is done one entry at a time, as it is to be expected
                 that overflows are either rare or short.  */
              cursor->next = table->free_entry_list;
@@ -995,13 +1032,14 @@ hash_print (const Hash_table *table)
       struct hash_entry *cursor;
 
       if (bucket)
-       printf ("%d:\n", slot);
+       printf ("%d:\n", bucket - table->bucket);
 
       for (cursor = bucket; cursor; cursor = cursor->next)
        {
          char *s = (char *) cursor->data;
          /* FIXME */
-         printf ("  %s\n", s);
+         if (s)
+           printf ("  %s\n", s);
        }
     }
 }
diff -pru .del/bison2/lib/hash.h bison/lib/hash.h
--- .del/bison2/lib/hash.h      2002-02-05 02:00:47.000000000 -0800
+++ bison/lib/hash.h    2002-08-12 07:11:02.000000000 -0700
@@ -1,5 +1,5 @@
 /* hash - hashing table processing.
-   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
    Written by Jim Meyering <address@hidden>, 1998.
 
    This program is free software; you can redistribute it and/or modify
@@ -21,13 +21,16 @@
 /* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
    obstacks instead of malloc, and recompile `hash.c' with same setting.  */
 
-#ifndef PARAMS
-# if PROTOTYPES || __STDC__
-#  define PARAMS(Args) Args
-# else
-#  define PARAMS(Args) ()
+#ifndef HASH_H_
+# define HASH_H_
+
+# ifndef PARAMS
+#  if PROTOTYPES || __STDC__
+#   define PARAMS(Args) Args
+#  else
+#   define PARAMS(Args) ()
+#  endif
 # endif
-#endif
 
 typedef unsigned (*Hash_hasher) PARAMS ((const void *, unsigned));
 typedef bool (*Hash_comparator) PARAMS ((const void *, const void *));
@@ -54,39 +57,7 @@ struct hash_tuning
 
 typedef struct hash_tuning Hash_tuning;
 
-struct hash_table
-  {
-    /* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
-       for a possibility of N_BUCKETS.  Among those, N_BUCKETS_USED buckets
-       are not empty, there are N_ENTRIES active entries in the table.  */
-    struct hash_entry *bucket;
-    struct hash_entry *bucket_limit;
-    unsigned n_buckets;
-    unsigned n_buckets_used;
-    unsigned n_entries;
-
-    /* Tuning arguments, kept in a physicaly separate structure.  */
-    const Hash_tuning *tuning;
-
-    /* Three functions are given to `hash_initialize', see the documentation
-       block for this function.  In a word, HASHER randomizes a user entry
-       into a number up from 0 up to some maximum minus 1; COMPARATOR returns
-       true if two user entries compare equally; and DATA_FREER is the cleanup
-       function for a user entry.  */
-    Hash_hasher hasher;
-    Hash_comparator comparator;
-    Hash_data_freer data_freer;
-
-    /* A linked list of freed struct hash_entry structs.  */
-    struct hash_entry *free_entry_list;
-
-#if USE_OBSTACK
-    /* Whenever obstacks are used, it is possible to allocate all overflowed
-       entries into a single stack, so they all can be freed in a single
-       operation.  It is not clear if the speedup is worth the trouble.  */
-    struct obstack entry_stack;
-#endif
-  };
+struct hash_table;
 
 typedef struct hash_table Hash_table;
 
@@ -118,3 +89,5 @@ void hash_free PARAMS ((Hash_table *));
 bool hash_rehash PARAMS ((Hash_table *, unsigned));
 void *hash_insert PARAMS ((Hash_table *, const void *));
 void *hash_delete PARAMS ((Hash_table *, const void *));
+
+#endif
diff -pru .del/bison2/lib/lbitset.c bison/lib/lbitset.c
--- .del/bison2/lib/lbitset.c   2002-07-02 06:51:26.000000000 -0700
+++ bison/lib/lbitset.c 2002-08-12 07:22:08.000000000 -0700
@@ -585,7 +585,8 @@ lbitset_set (dst, bitno)
 
   lbitset_elt_find (dst, windex, LBITSET_CREATE);
 
-  dst->b.cdata[windex - dst->b.cindex] |= (1 << (bitno % BITSET_WORD_BITS));
+  dst->b.cdata[windex - dst->b.cindex] |=
+    (bitset_word) 1 << (bitno % BITSET_WORD_BITS);
 }
 
 
@@ -600,7 +601,8 @@ lbitset_reset (dst, bitno)
   if (!lbitset_elt_find (dst, windex, LBITSET_FIND))
     return;
 
-  dst->b.cdata[windex - dst->b.cindex] &= ~(1 << (bitno % BITSET_WORD_BITS));
+  dst->b.cdata[windex - dst->b.cindex] &=
+    ~((bitset_word) 1 << (bitno % BITSET_WORD_BITS));
 
   /* If all the data is zero, perhaps we should unlink it now...  */
 }
@@ -951,7 +953,7 @@ lbitset_op1 (dst, op)
        {
          /* Create new elements if they cannot be found.  */
          elt = lbitset_elt_find (dst, i, LBITSET_CREATE);
-         memset (elt->words, ~0, sizeof (elt->words));
+         memset (elt->words, -1, sizeof (elt->words));
        }
       break;
 
diff -pru .del/bison2/lib/Makefile.am bison/lib/Makefile.am
--- .del/bison2/lib/Makefile.am 2002-07-31 12:52:13.000000000 -0700
+++ bison/lib/Makefile.am       2002-08-12 07:08:04.000000000 -0700
@@ -21,12 +21,9 @@ CFLAGS = @CFLAGS@ $(WARNING_CFLAGS)
 
 noinst_LIBRARIES = libbison.a
 
-# libintl.h in is build/intl, libgettext.h in src/intl/,
-# config.h in build/., and system.h is in src/src/.
-INCLUDES = -I$(top_builddir)/intl \
-           -I$(top_builddir)      \
+# config.h is in build/., and system.h is in src/src/.
+INCLUDES = -I$(top_builddir)      \
            -I$(top_srcdir)/src \
-           -I$(top_srcdir)/intl \
            -I$(top_srcdir)/lib
 
 # Heck, we are still using an old version of Automake which does not
@@ -41,22 +38,23 @@ libbison_a_SOURCES = \
   getopt.h getopt.c getopt1.c \
   hash.h hash.c \
   quote.h quote.c quotearg.h quotearg.c \
+  readpipe.c unlocked-io.h \
   xalloc.h xmalloc.c xstrdup.c xstrndup.c \
-  readpipe.c
+  $(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources)
 
 # Implementation of bitsets
-libbison_a_SOURCES += \
+bitsets_sources = \
 libiberty.h \
 abitset.c  bitset.c        bitset_stats.h  ebitset.c  lbitset.h \
 abitset.h  bitset.h        bitsetv.c       ebitset.h \
 bbitset.h  bitset_stats.c  bitsetv.h       lbitset.c
 
 # Additional bitset operations.
-libbison_a_SOURCES += \
+additional_bitsets_sources = \
        bitsetv-print.h bitsetv-print.c
 
 # timevars, stolen from GCC.
-libbison_a_SOURCES += \
+timevars_sources = \
        timevar.h timevar.c timevar.def
 
 libbison_a_LIBADD = @LIBOBJS@ @ALLOCA@
diff -pru .del/bison2/lib/memrchr.c bison/lib/memrchr.c
--- .del/bison2/lib/memrchr.c   2002-01-08 09:27:46.000000000 -0800
+++ bison/lib/memrchr.c 2002-08-12 07:12:13.000000000 -0700
@@ -6,20 +6,19 @@
    adaptation to memchr suggested by Dick Karpinski (address@hidden),
    and implemented by Roland McGrath (address@hidden).
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
-   The GNU C Library is distributed in the hope that it will be useful,
+   This program 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
-   Library General Public License for more details.
+   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 Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
diff -pru .del/bison2/lib/mkstemp.c bison/lib/mkstemp.c
--- .del/bison2/lib/mkstemp.c   2002-02-25 05:44:43.000000000 -0800
+++ bison/lib/mkstemp.c 2002-08-12 07:12:13.000000000 -0700
@@ -1,20 +1,19 @@
 /* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
    This file is derived from the one in the GNU C Library.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
-   The GNU C Library is distributed in the hope that it will be useful,
+   This program 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
-   Library General Public License for more details.
+   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 Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include <config.h>
 
diff -pru .del/bison2/lib/obstack.c bison/lib/obstack.c
--- .del/bison2/lib/obstack.c   2001-10-26 00:26:00.000000000 -0700
+++ bison/lib/obstack.c 2002-08-12 07:12:57.000000000 -0700
@@ -1,22 +1,24 @@
 /* obstack.c - subroutines used implicitly by object stack macros
-   Copyright (C) 1988-1994,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+
+   Copyright (C) 1988-1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Free Software Foundation, Inc.
+
    This file is part of the GNU C Library.  Its master source is NOT part of
    the C library, however.  The master source lives in /gd/gnu/lib.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
-   The GNU C Library is distributed in the hope that it will be useful,
+   This program 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
-   Lesser General Public License for more details.
+   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 Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -53,7 +55,7 @@
 #ifndef ELIDE_CODE
 
 
-# if defined __STDC__ && __STDC__
+# ifdef __STDC__
 #  define POINTER void *
 # else
 #  define POINTER char *
@@ -84,7 +86,7 @@ union fooround {long x; double d;};
    abort gracefully or use longjump - but shouldn't return.  This
    variable by default points to the internal function
    `print_and_abort'.  */
-# if defined __STDC__ && __STDC__
+# if PROTOTYPES || (defined __STDC__ && __STDC__)
 static void print_and_abort (void);
 void (*obstack_alloc_failed_handler) (void) = print_and_abort;
 # else
@@ -112,7 +114,7 @@ struct obstack *_obstack;
    For free, do not use ?:, since some compilers, like the MIPS compilers,
    do not allow (expr) ? void : void.  */
 
-# if defined __STDC__ && __STDC__
+# if PROTOTYPES || (defined __STDC__ && __STDC__)
 #  define CALL_CHUNKFUN(h, size) \
   (((h) -> use_extra_arg) \
    ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
@@ -154,7 +156,7 @@ _obstack_begin (h, size, alignment, chun
      struct obstack *h;
      int size;
      int alignment;
-# if defined __STDC__ && __STDC__
+# if PROTOTYPES || (defined __STDC__ && __STDC__)
      POINTER (*chunkfun) (long);
      void (*freefun) (void *);
 # else
@@ -183,7 +185,7 @@ _obstack_begin (h, size, alignment, chun
       size = 4096 - extra;
     }
 
-# if defined __STDC__ && __STDC__
+# if PROTOTYPES || (defined __STDC__ && __STDC__)
   h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
   h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
 # else
@@ -212,7 +214,7 @@ _obstack_begin_1 (h, size, alignment, ch
      struct obstack *h;
      int size;
      int alignment;
-# if defined __STDC__ && __STDC__
+# if PROTOTYPES || (defined __STDC__ && __STDC__)
      POINTER (*chunkfun) (POINTER, long);
      void (*freefun) (POINTER, POINTER);
 # else
@@ -242,7 +244,7 @@ _obstack_begin_1 (h, size, alignment, ch
       size = 4096 - extra;
     }
 
-# if defined __STDC__ && __STDC__
+# if PROTOTYPES || (defined __STDC__ && __STDC__)
   h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
   h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
 # else
@@ -343,7 +345,7 @@ _obstack_newchunk (h, length)
    This is here for debugging.
    If you use it in a program, you are probably losing.  */
 
-# if defined __STDC__ && __STDC__
+# if PROTOTYPES || (defined __STDC__ && __STDC__)
 /* Suppress -Wmissing-prototypes warning.  We don't want to declare this in
    obstack.h because it is just for debugging.  */
 int _obstack_allocated_p (struct obstack *h, POINTER obj);
@@ -505,7 +507,7 @@ print_and_abort ()
 /* Now define the functional versions of the obstack macros.
    Define them to simply use the corresponding macros to do the job.  */
 
-#  if defined __STDC__ && __STDC__
+#  if PROTOTYPES || (defined __STDC__ && __STDC__)
 /* These function definitions do not work with non-ANSI preprocessors;
    they won't pass through the macro names in parentheses.  */
 
@@ -616,7 +618,7 @@ POINTER (obstack_copy0) (obstack, addres
   return obstack_copy0 (obstack, address, length);
 }
 
-#  endif /* __STDC__ */
+#  endif /* PROTOTYPES || (defined __STDC__ && __STDC__) */
 
 # endif /* 0 */
 
diff -pru .del/bison2/lib/obstack.h bison/lib/obstack.h
--- .del/bison2/lib/obstack.h   2001-10-26 00:26:00.000000000 -0700
+++ bison/lib/obstack.h 2002-08-12 07:12:57.000000000 -0700
@@ -1,5 +1,7 @@
 /* obstack.h - object stack macros
-   Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, 
Inc.
+
+   Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
+   1998, 1999, 2002 Free Software Foundation, Inc.
 
    This file is part of the GNU C Library.  Its master source is NOT part of
    the C library, however.  The master source lives in /gd/gnu/lib.
@@ -7,20 +9,19 @@
    NOTE: The canonical source of this file is maintained with the GNU C 
Library.
    Bugs can be reported to address@hidden
 
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 2, or (at your option) any
-   later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
    This program 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
-   Library General Public License for more details.
+   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 Library General Public
-   License along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-   USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Summary:
 
@@ -123,7 +124,11 @@ extern "C" {
 #endif
 
 #ifndef __INT_TO_PTR
-# define __INT_TO_PTR(P) ((P) + (char *) 0)
+# ifdef __STDC__
+#  define __INT_TO_PTR(P) ((void *) ((P) + (char *) 0))
+# else
+#  define __INT_TO_PTR(P) ((P) + (char *) 0)
+# endif
 #endif
 
 /* We need the type of the resulting object.  If __PTRDIFF_TYPE__ is
@@ -170,7 +175,7 @@ struct obstack              /* control current objec
   char *chunk_limit;           /* address of char after current chunk */
   PTR_INT_TYPE temp;           /* Temporary for some macros.  */
   int   alignment_mask;                /* Mask of alignment for each object. */
-#if defined __STDC__ && __STDC__
+#if PROTOTYPES || (defined __STDC__ && __STDC__)
   /* These prototypes vary based on `use_extra_arg', and we use
      casts to the prototypeless function type in all assignments,
      but having prototypes here quiets -Wstrict-prototypes.  */
@@ -194,7 +199,7 @@ struct obstack              /* control current objec
 
 /* Declare the external functions we use; they are in obstack.c.  */
 
-#if defined __STDC__ && __STDC__
+#if PROTOTYPES || (defined __STDC__ && __STDC__)
 extern void _obstack_newchunk (struct obstack *, int);
 extern void _obstack_free (struct obstack *, void *);
 extern int _obstack_begin (struct obstack *, int, int,
@@ -211,7 +216,7 @@ extern int _obstack_begin_1 ();
 extern int _obstack_memory_used ();
 #endif
 
-#if defined __STDC__ && __STDC__
+#if PROTOTYPES || (defined __STDC__ && __STDC__)
 
 /* Do the function-declarations after the structs
    but before defining the macros.  */
@@ -251,7 +256,7 @@ int obstack_alignment_mask (struct obsta
 int obstack_chunk_size (struct obstack *obstack);
 int obstack_memory_used (struct obstack *obstack);
 
-#endif /* __STDC__ */
+#endif /* PROTOTYPES || (defined __STDC__ && __STDC__) */
 
 /* Non-ANSI C cannot really support alternative functions for these macros,
    so we do not declare them.  */
@@ -260,7 +265,7 @@ int obstack_memory_used (struct obstack 
    more memory.  This can be set to a user defined function which
    should either abort gracefully or use longjump - but shouldn't
    return.  The default action is to print a message and abort.  */
-#if defined __STDC__ && __STDC__
+#if PROTOTYPES || (defined __STDC__ && __STDC__)
 extern void (*obstack_alloc_failed_handler) (void);
 #else
 extern void (*obstack_alloc_failed_handler) ();
@@ -289,7 +294,7 @@ extern int obstack_exit_failure;
 
 /* To prevent prototype warnings provide complete argument list in
    standard C version.  */
-#if defined __STDC__ && __STDC__
+#if PROTOYPES || (defined __STDC__ && __STDC__)
 
 # define obstack_init(h)                                       \
   _obstack_begin ((h), 0, 0,                                   \
@@ -584,7 +589,7 @@ __extension__                                               
                \
   (h)->object_base = (h)->next_free,                                   \
   __INT_TO_PTR ((h)->temp))
 
-# if defined __STDC__ && __STDC__
+# if PROTOTYPES || (defined __STDC__ && __STDC__)
 #  define obstack_free(h,obj)                                          \
 ( (h)->temp = (char *) (obj) - (char *) (h)->chunk,                    \
   (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
diff -pru .del/bison2/lib/quotearg.c bison/lib/quotearg.c
--- .del/bison2/lib/quotearg.c  2002-01-03 01:55:33.000000000 -0800
+++ bison/lib/quotearg.c        2002-08-12 07:10:23.000000000 -0700
@@ -1,5 +1,5 @@
 /* quotearg.c - quote arguments for output
-   Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002 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
@@ -305,6 +305,16 @@ quotearg_buffer_restyled (char *buffer, 
       c = arg[i];
       switch (c)
        {
+       case '\0':
+         if (backslash_escapes)
+           {
+             STORE ('\\');
+             STORE ('0');
+             STORE ('0');
+             c = '0';
+           }
+         break;
+
        case '?':
          switch (quoting_style)
            {
@@ -531,14 +541,15 @@ quotearg_buffer (char *buffer, size_t bu
                                   p->style, p);
 }
 
-/* Use storage slot N to return a quoted version of the string ARG.
+/* Use storage slot N to return a quoted version of argument ARG.
+   ARG is of size ARGSIZE, but if that is -1, ARG is a null-terminated string.
    OPTIONS specifies the quoting options.
    The returned value points to static storage that can be
    reused by the next call to this function with the same value of N.
    N must be nonnegative.  N is deliberately declared with type "int"
    to allow for future extensions (using negative values).  */
 static char *
-quotearg_n_options (int n, char const *arg,
+quotearg_n_options (int n, char const *arg, size_t argsize,
                    struct quoting_options const *options)
 {
   /* Preallocate a slot 0 buffer, so that the caller can always quote
@@ -579,13 +590,13 @@ quotearg_n_options (int n, char const *a
   {
     size_t size = slotvec[n].size;
     char *val = slotvec[n].val;
-    size_t qsize = quotearg_buffer (val, size, arg, (size_t) -1, options);
+    size_t qsize = quotearg_buffer (val, size, arg, argsize, options);
 
     if (size <= qsize)
       {
        slotvec[n].size = size = qsize + 1;
        slotvec[n].val = val = xrealloc (val == slot0 ? 0 : val, size);
-       quotearg_buffer (val, size, arg, (size_t) -1, options);
+       quotearg_buffer (val, size, arg, argsize, options);
       }
 
     return val;
@@ -595,7 +606,7 @@ quotearg_n_options (int n, char const *a
 char *
 quotearg_n (int n, char const *arg)
 {
-  return quotearg_n_options (n, arg, &default_quoting_options);
+  return quotearg_n_options (n, arg, (size_t) -1, &default_quoting_options);
 }
 
 char *
@@ -604,13 +615,29 @@ quotearg (char const *arg)
   return quotearg_n (0, arg);
 }
 
-char *
-quotearg_n_style (int n, enum quoting_style s, char const *arg)
+/* Return quoting options for STYLE, with no extra quoting.  */
+static struct quoting_options
+quoting_options_from_style (enum quoting_style style)
 {
   struct quoting_options o;
-  o.style = s;
+  o.style = style;
   memset (o.quote_these_too, 0, sizeof o.quote_these_too);
-  return quotearg_n_options (n, arg, &o);
+  return o;
+}
+
+char *
+quotearg_n_style (int n, enum quoting_style s, char const *arg)
+{
+  struct quoting_options const o = quoting_options_from_style (s);
+  return quotearg_n_options (n, arg, (size_t) -1, &o);
+}
+
+char *
+quotearg_n_style_mem (int n, enum quoting_style s,
+                     char const *arg, size_t argsize)
+{
+  struct quoting_options const o = quoting_options_from_style (s);
+  return quotearg_n_options (n, arg, argsize, &o);
 }
 
 char *
@@ -625,7 +652,7 @@ quotearg_char (char const *arg, char ch)
   struct quoting_options options;
   options = default_quoting_options;
   set_char_quoting (&options, ch, 1);
-  return quotearg_n_options (0, arg, &options);
+  return quotearg_n_options (0, arg, (size_t) -1, &options);
 }
 
 char *
diff -pru .del/bison2/lib/quotearg.h bison/lib/quotearg.h
--- .del/bison2/lib/quotearg.h  2002-07-09 23:24:51.000000000 -0700
+++ bison/lib/quotearg.h        2002-08-12 07:10:23.000000000 -0700
@@ -104,6 +104,12 @@ char *quotearg PARAMS ((char const *arg)
    options to specify the quoting method.  */
 char *quotearg_n_style PARAMS ((int n, enum quoting_style s, char const *arg));
 
+/* Use style S and storage slot N to return a quoted version of the
+   argument ARG of size ARGSIZE.  This is like quotearg_n_style
+   (N, S, ARG), except it can quote null bytes.  */
+char *quotearg_n_style_mem PARAMS ((int n, enum quoting_style s,
+                                   char const *arg, size_t argsize));
+
 /* Equivalent to quotearg_n_style (0, S, ARG).  */
 char *quotearg_style PARAMS ((enum quoting_style s, char const *arg));
 
diff -pru .del/bison2/lib/strchr.c bison/lib/strchr.c
--- .del/bison2/lib/strchr.c    2001-12-27 10:12:48.000000000 -0800
+++ bison/lib/strchr.c  2002-08-12 07:12:13.000000000 -0700
@@ -1,19 +1,18 @@
 /* Copyright (C) 2001 Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License
-   as published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with this program; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place -
-   Suite 330, Boston, MA 02111-1307, USA.  */
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program 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 this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #if HAVE_CONFIG_H
 # include <config.h>
diff -pru .del/bison2/lib/strnlen.c bison/lib/strnlen.c
--- .del/bison2/lib/strnlen.c   2001-10-26 00:26:00.000000000 -0700
+++ bison/lib/strnlen.c 2002-08-12 07:11:02.000000000 -0700
@@ -1,21 +1,20 @@
 /* Find the length of STRING, but scan at most MAXLEN characters.
-   Copyright (C) 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 2000-2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
-   The GNU C Library is distributed in the hope that it will be useful,
+   This program 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
-   Library General Public License for more details.
+   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 Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #if HAVE_CONFIG_H
 # include <config.h>
@@ -25,7 +24,11 @@
 # if !STDC_HEADERS && HAVE_MEMORY_H
 #  include <memory.h>
 # endif
+/* Temporarily redefine strnlen so that an inconsistent prototype
+   (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't cause trouble.  */
+# define strnlen system_strnlen
 # include <string.h>
+# undef strnlen
 #else
 # include <strings.h>
 #endif
diff -pru .del/bison2/lib/strspn.c bison/lib/strspn.c
--- .del/bison2/lib/strspn.c    2001-08-03 01:09:03.000000000 -0700
+++ bison/lib/strspn.c  2002-08-12 07:12:13.000000000 -0700
@@ -3,20 +3,19 @@
    NOTE: The canonical source of this file is maintained with the GNU
    C Library.  Bugs can be reported to address@hidden
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License
-   as published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with this program; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place -
-   Suite 330, Boston, MA 02111-1307, USA.  */
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program 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 this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #if HAVE_CONFIG_H
 # include <config.h>
diff -pru .del/bison2/lib/tempname.c bison/lib/tempname.c
--- .del/bison2/lib/tempname.c  2002-02-25 05:44:43.000000000 -0800
+++ bison/lib/tempname.c        2002-08-12 07:12:13.000000000 -0700
@@ -1,20 +1,19 @@
 /* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
 
-   The GNU C Library is distributed in the hope that it will be useful,
+   This program 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
-   Lesser General Public License for more details.
+   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 Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #if HAVE_CONFIG_H
 # include <config.h>
Only in bison/lib: unlocked-io.h
diff -pru .del/bison2/lib/xmalloc.c bison/lib/xmalloc.c
--- .del/bison2/lib/xmalloc.c   2001-10-26 00:26:00.000000000 -0700
+++ bison/lib/xmalloc.c 2002-08-12 07:11:02.000000000 -0700
@@ -1,5 +1,5 @@
 /* xmalloc.c -- malloc with out of memory checking
-   Copyright (C) 1990-1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1990-1999, 2000, 2002 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
@@ -46,12 +46,12 @@ void free ();
 # define EXIT_FAILURE 1
 #endif
 
-#ifndef HAVE_DONE_WORKING_MALLOC_CHECK
-"you must run the autoconf test for a properly working malloc -- see malloc.m4"
+#ifndef HAVE_MALLOC
+"you must run the autoconf test for a properly working malloc"
 #endif
 
-#ifndef HAVE_DONE_WORKING_REALLOC_CHECK
-"you must run the autoconf test for a properly working realloc --see 
realloc.m4"
+#ifndef HAVE_REALLOC
+"you must run the autoconf test for a properly working realloc"
 #endif
 
 /* Exit value when the requested amount of memory is not available.
diff -pru .del/bison2/m4/c-bs-a.m4 bison/m4/c-bs-a.m4
--- .del/bison2/m4/c-bs-a.m4    2001-10-26 00:26:00.000000000 -0700
+++ bison/m4/c-bs-a.m4  2002-08-12 07:26:37.000000000 -0700
@@ -1,4 +1,10 @@
-#serial 4
+# c-bs-a.m4 serial 4 (fileutils-4.1.3)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
 
 dnl From Paul Eggert.
 
diff -pru .del/bison2/m4/Makefile.am bison/m4/Makefile.am
--- .del/bison2/m4/Makefile.am  2002-07-31 12:52:13.000000000 -0700
+++ bison/m4/Makefile.am        2002-08-12 07:23:35.000000000 -0700
@@ -1,23 +1,6 @@
 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
-EXTRA_DIST = lib-ld.m4 lib-link.m4 lib-prefix.m4                               
        \
-c-bs-a.m4                                      \
-codeset.m4                                     \
-dmalloc.m4                                     \
-error.m4                                       \
-gettext.m4                                     \
-glibc21.m4                                     \
-iconv.m4                                       \
-isc-posix.m4                                   \
-lcmessage.m4                                   \
-m4.m4                                          \
-malloc.m4                                      \
-mbrtowc.m4                                     \
-mbstate_t.m4                                   \
-mkstemp.m4                                     \
-prereq.m4                                      \
-progtest.m4                                    \
-realloc.m4                                     \
-stage.m4                                       \
-strerror_r.m4                                  \
-timevar.m4                                     \
-warning.m4
+EXTRA_DIST = \
+  c-bs-a.m4 dmalloc.m4 error.m4 \
+  m4.m4 malloc.m4 mbrtowc.m4 mbstate_t.m4 mkstemp.m4 \
+  prereq.m4 realloc.m4 strerror_r.m4 timevar.m4 warning.m4 \
+  gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4
diff -pru .del/bison2/m4/malloc.m4 bison/m4/malloc.m4
--- .del/bison2/m4/malloc.m4    2001-10-26 00:26:00.000000000 -0700
+++ bison/m4/malloc.m4  2002-08-12 07:25:03.000000000 -0700
@@ -1,4 +1,4 @@
-#serial 5
+#serial 7
 
 dnl From Jim Meyering.
 dnl Determine whether malloc accepts 0 as its argument.
@@ -12,7 +12,8 @@ AC_DEFUN([jm_FUNC_MALLOC],
  AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
            [Define if the malloc check has been performed. ])
 
- AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
+ AC_CACHE_CHECK([whether malloc(0) returns a non-NULL pointer],
+                jm_cv_func_working_malloc,
   [AC_TRY_RUN([
     char *malloc ();
     int
@@ -23,10 +24,15 @@ AC_DEFUN([jm_FUNC_MALLOC],
          ],
         jm_cv_func_working_malloc=yes,
         jm_cv_func_working_malloc=no,
-        dnl When crosscompiling, assume malloc is broken.
+        dnl When crosscompiling, assume malloc(0) returns NULL.
         jm_cv_func_working_malloc=no)
   ])
-  if test $jm_cv_func_working_malloc = no; then
+  if test $jm_cv_func_working_malloc = yes; then
+    AC_DEFINE([HAVE_MALLOC], 1,
+             [Define to 1 if your system has a working `malloc' function,
+              and to 0 otherwise.])
+  else
+    AC_DEFINE([HAVE_MALLOC], 0)
     AC_LIBOBJ(malloc)
     AC_DEFINE(malloc, rpl_malloc,
       [Define to rpl_malloc if the replacement function should be used.])
diff -pru .del/bison2/m4/mbrtowc.m4 bison/m4/mbrtowc.m4
--- .del/bison2/m4/mbrtowc.m4   2001-10-04 07:55:20.000000000 -0700
+++ bison/m4/mbrtowc.m4 2002-08-12 07:26:37.000000000 -0700
@@ -1,4 +1,10 @@
-#serial 4
+# mbrtowc.m4 serial 4 (fileutils-4.1.3)
+dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
 
 dnl From Paul Eggert
 
diff -pru .del/bison2/m4/mbstate_t.m4 bison/m4/mbstate_t.m4
--- .del/bison2/m4/mbstate_t.m4 2001-10-26 00:26:00.000000000 -0700
+++ bison/m4/mbstate_t.m4       2002-08-12 07:25:24.000000000 -0700
@@ -1,4 +1,10 @@
-# serial 9
+# mbstate_t.m4 serial 9
+dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
 
 # From Paul Eggert.
 
@@ -6,24 +12,21 @@
 # so you can't declare an object of that type.
 # Check for this incompatibility with Standard C.
 
-# Include stdlib.h first, because otherwise this test would fail on Linux
-# (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
-# a syntax error in wchar.h due to the use of undefined __int32_t.
-
-AC_DEFUN([AC_MBSTATE_T],
-  [
-   AC_CHECK_HEADERS(stdlib.h)
-
-   AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
-    [AC_TRY_COMPILE([
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#include <wchar.h>],
-      [mbstate_t x; return sizeof x;],
-      ac_cv_type_mbstate_t=yes,
-      ac_cv_type_mbstate_t=no)])
-   if test $ac_cv_type_mbstate_t = no; then
-     AC_DEFINE(mbstate_t, int,
+# AC_TYPE_MBSTATE_T
+# -----------------
+AC_DEFUN([AC_TYPE_MBSTATE_T],
+  [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
+     [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [AC_INCLUDES_DEFAULT
+#          include <wchar.h>],
+          [mbstate_t x; return sizeof x;])],
+       [ac_cv_type_mbstate_t=yes],
+       [ac_cv_type_mbstate_t=no])])
+   if test $ac_cv_type_mbstate_t = yes; then
+     AC_DEFINE([HAVE_MBSTATE_T], 1,
+              [Define to 1 if <wchar.h> declares mbstate_t.])
+   else
+     AC_DEFINE([mbstate_t], int,
               [Define to a type if <wchar.h> does not define.])
    fi])
diff -pru .del/bison2/m4/prereq.m4 bison/m4/prereq.m4
--- .del/bison2/m4/prereq.m4    2001-10-04 07:55:20.000000000 -0700
+++ bison/m4/prereq.m4  2002-08-12 07:25:56.000000000 -0700
@@ -10,6 +10,6 @@ AC_DEFUN([jm_PREREQ_QUOTEARG],
   AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
   AC_HEADER_STDC
   AC_C_BACKSLASH_A
-  AC_MBSTATE_T
+  AC_TYPE_MBSTATE_T
   AM_C_PROTOTYPES
 ])
diff -pru .del/bison2/m4/realloc.m4 bison/m4/realloc.m4
--- .del/bison2/m4/realloc.m4   2001-10-26 00:26:00.000000000 -0700
+++ bison/m4/realloc.m4 2002-08-12 07:25:03.000000000 -0700
@@ -1,4 +1,4 @@
-#serial 5
+#serial 6
 
 dnl From Jim Meyering.
 dnl Determine whether realloc works when both arguments are 0.
@@ -12,7 +12,8 @@ AC_DEFUN([jm_FUNC_REALLOC],
  AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
            [Define if the realloc check has been performed. ])
 
- AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
+ AC_CACHE_CHECK([whether realloc(0,0) returns a non-NULL pointer],
+                jm_cv_func_working_realloc,
   [AC_TRY_RUN([
     char *realloc ();
     int
@@ -23,10 +24,15 @@ AC_DEFUN([jm_FUNC_REALLOC],
          ],
         jm_cv_func_working_realloc=yes,
         jm_cv_func_working_realloc=no,
-        dnl When crosscompiling, assume realloc is broken.
+        dnl When crosscompiling, assume realloc(0,0) returns NULL.
         jm_cv_func_working_realloc=no)
   ])
-  if test $jm_cv_func_working_realloc = no; then
+  if test $jm_cv_func_working_realloc = yes; then
+    AC_DEFINE([HAVE_REALLOC], 1,
+             [Define to 1 if your system has a working `realloc' function,
+              and to 0 otherwise.])
+  else
+    AC_DEFINE([HAVE_REALLOC], 0)
     AC_LIBOBJ(realloc)
     AC_DEFINE(realloc, rpl_realloc,
       [Define to rpl_realloc if the replacement function should be used.])
Only in .del/bison2/m4: stage.m4
diff -pru .del/bison2/Makefile.am bison/Makefile.am
--- .del/bison2/Makefile.am     2002-05-03 09:10:29.000000000 -0700
+++ bison/Makefile.am   2002-08-12 06:58:17.000000000 -0700
@@ -1,4 +1,4 @@
-## Copyright 2001, 2002 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002 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
@@ -20,12 +20,10 @@ AUTOMAKE_OPTIONS = 1.6 check-news readme
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = config intl po lib data src doc m4 tests
+SUBDIRS = config po lib data src doc m4 tests
 
 EXTRA_DIST = REFERENCES OChangeLog Makefile.maint GNUmakefile
 
-DISTCLEANFILES = intl/libintl.h
-
 
 ## ---------------------------- ##
 ## Customizing Makefile.maint.  ##
diff -pru .del/bison2/NEWS bison/NEWS
--- .del/bison2/NEWS    2002-07-30 04:56:44.000000000 -0700
+++ bison/NEWS  2002-08-12 06:59:13.000000000 -0700
@@ -1,7 +1,7 @@
 Bison News
 ----------
 
-Changes in version 1.49b:
+Changes in version 1.49b, 2002-08-12:
 
 * GLR parsing
   The declaration
@@ -49,9 +49,11 @@ Changes in version 1.49b:
 * Traces
   Popped tokens and nonterminals are now reported.
 
-* Large grammars
-  Large grammars are now supported (large token numbers, large grammar
-  size (= sum of the LHS and RHS lengths), large LALR tables).
+* Larger grammars
+  Larger grammars are now supported (larger token numbers, larger grammar
+  size (= sum of the LHS and RHS lengths), larger LALR tables).
+  Formerly, many of these numbers ran afoul of 16-bit limits;
+  now these limits are 32 bits on most hosts.
 
 * Explicit initial rule
   Bison used to play hacks with the initial rule, which the user does
@@ -91,7 +93,7 @@ Changes in version 1.49b:
 * Token end-of-file
   The token end of file may be specified by the user, in which case,
   the user symbol is used in the reports, the graphs, and the verbose
-  error messages instead of `$end', which remains being the defaults.
+  error messages instead of `$end', which remains being the default.
   For instance
      %token YYEOF 0
   or
@@ -100,7 +102,8 @@ Changes in version 1.49b:
 * Semantic parser
   This old option, which has been broken for ages, is removed.
 
-* New translation
+* New translations
+  Brazilian Portuguese, thanks to Alexandre Folle de Menezes.
   Croatian, thanks to Denis Lackovic.
 
 * Incorrect token definitions
@@ -132,6 +135,8 @@ Changes in version 1.49b:
       bar: '0' {} '0';
 
   This is fixed.
+
+* GNU M4 is now required when using Bison.
 
 Changes in version 1.35, 2002-03-25:
 
diff -pru .del/bison2/po/LINGUAS bison/po/LINGUAS
--- .del/bison2/po/LINGUAS      2002-05-02 08:13:09.000000000 -0700
+++ bison/po/LINGUAS    2002-08-12 08:05:54.000000000 -0700
@@ -6,6 +6,7 @@ hr
 it
 ja
 nl
+pt_BR
 ru
 sv
 tr
diff -pru .del/bison2/po/POTFILES.in bison/po/POTFILES.in
--- .del/bison2/po/POTFILES.in  2002-07-31 14:52:00.000000000 -0700
+++ bison/po/POTFILES.in        2002-08-12 07:28:29.000000000 -0700
@@ -1,21 +1,29 @@
 src/LR0.c
+src/assoc.c
+src/closure.c
 src/complain.c
 src/conflicts.c
 src/files.c
 src/getargs.c
+src/gram.c
 src/lalr.c
-src/parse-gram.c
+src/main.c
+src/parse-gram.y
 src/print.c
 src/reader.c
 src/reduce.c
-src/scan-gram.c
+src/relation.c
+src/scan-gram.l
+src/state.c
 src/symlist.c
 src/symtab.c
 src/tables.c
 
 lib/argmatch.c
+lib/bitset_stats.c
 lib/error.c
 lib/getopt.c
 lib/obstack.c
 lib/quotearg.c
+lib/timevar.c
 lib/xmalloc.c
Only in bison/po: pt_BR.po
diff -pru .del/bison2/src/assoc.c bison/src/assoc.c
--- .del/bison2/src/assoc.c     2002-07-16 07:04:06.000000000 -0700
+++ bison/src/assoc.c   2002-08-12 07:34:51.000000000 -0700
@@ -28,7 +28,7 @@ assoc_to_string (assoc_t assoc)
   switch (assoc)
     {
     case undef_assoc:
-      return "undefined associativity";
+      return _("undefined associativity");
 
     case right_assoc:
       return "%right";
diff -pru .del/bison2/src/closure.c bison/src/closure.c
--- .del/bison2/src/closure.c   2002-08-01 11:13:29.000000000 -0700
+++ bison/src/closure.c 2002-08-12 07:36:09.000000000 -0700
@@ -53,14 +53,14 @@ static void
 print_closure (const char *title, item_number_t *array, size_t size)
 {
   size_t i;
-  fprintf (stderr, "Closure: %s\n", title);
+  fprintf (stderr, _("Closure: %s\n"), title);
   for (i = 0; i < size; ++i)
     {
       item_number_t *rp;
       fprintf (stderr, "  %2d: .", array[i]);
       for (rp = &ritem[array[i]]; *rp >= 0; ++rp)
        fprintf (stderr, " %s", symbols[*rp]->tag);
-      fprintf (stderr, "  (rule %d)\n", -*rp - 1);
+      fprintf (stderr, _("  (rule %d)\n"), -*rp - 1);
     }
   fputs ("\n\n", stderr);
 }
@@ -133,10 +133,10 @@ set_firsts (void)
       }
 
   if (trace_flag & trace_sets)
-    bitsetv_matrix_dump (stderr, "RTC: Firsts Input", firsts);
+    bitsetv_matrix_dump (stderr, _("RTC: Firsts Input"), firsts);
   bitsetv_reflexive_transitive_closure (firsts);
   if (trace_flag & trace_sets)
-    bitsetv_matrix_dump (stderr, "RTC: Firsts Output", firsts);
+    bitsetv_matrix_dump (stderr, _("RTC: Firsts Output"), firsts);
 
   if (trace_flag & trace_sets)
     print_firsts ();
@@ -200,7 +200,7 @@ closure (item_number_t *core, int n)
   bitset_iterator iter;
 
   if (trace_flag & trace_sets)
-    print_closure ("input", core, n);
+    print_closure (_("input"), core, n);
 
   bitset_zero (ruleset);
 
@@ -231,7 +231,7 @@ closure (item_number_t *core, int n)
     }
 
   if (trace_flag & trace_sets)
-    print_closure ("output", itemset, nritemset);
+    print_closure (_("output"), itemset, nritemset);
 }
 
 
diff -pru .del/bison2/src/complain.c bison/src/complain.c
--- .del/bison2/src/complain.c  2002-07-30 04:09:59.000000000 -0700
+++ bison/src/complain.c        2002-08-12 07:36:57.000000000 -0700
@@ -43,13 +43,6 @@ void exit ();
 
 #include "complain.h"
 
-#ifndef HAVE_DECL_STRERROR_R
-"this configure-time declaration test was not run"
-#endif
-#if !HAVE_DECL_STRERROR_R
-char *strerror_r ();
-#endif
-
 #ifndef _
 # define _(String) String
 #endif
@@ -76,14 +69,14 @@ char *strerror_r ();
    name of the executing program.  */
 extern char *program_name;
 
-# ifdef HAVE_STRERROR_R
-#  define __strerror_r strerror_r
+# if HAVE_STRERROR
+#  ifndef HAVE_DECL_STRERROR
+"this configure-time declaration test was not run"
+#  endif
+#  if !HAVE_DECL_STRERROR && !defined strerror
+char *strerror PARAMS ((int));
+#  endif
 # else
-#  if HAVE_STRERROR
-#   ifndef strerror            /* On some systems, strerror is a macro */
-char *strerror ();
-#   endif
-#  else
 static char *
 private_strerror (errnum)
      int errnum;
@@ -95,9 +88,8 @@ private_strerror (errnum)
     return _(sys_errlist[errnum]);
   return _("Unknown system error");
 }
-#   define strerror private_strerror
-#  endif /* HAVE_STRERROR */
-# endif        /* HAVE_STRERROR_R */
+#  define strerror private_strerror
+# endif /* HAVE_STRERROR */
 #endif /* not _LIBC */
 
 /* This variable is incremented each time `warn' is called.  */
diff -pru .del/bison2/src/files.c bison/src/files.c
--- .del/bison2/src/files.c     2002-06-18 05:39:54.000000000 -0700
+++ bison/src/files.c   2002-08-12 07:38:04.000000000 -0700
@@ -99,49 +99,6 @@ stringappend (const char *string1, const
   return res;
 }
 
-
-/*-----------------------------------------------------------------.
-| Computes the macro name used to avoid double inclusion in the    |
-| header of the parser and store it in header_macro_name.  Be sure |
-| to produce valid CPP names (don't start with digit, remain       |
-| alphanumerical + underscore).                                    |
-`-----------------------------------------------------------------*/
-
-char *
-compute_header_macro (void)
-{
-  const char *prefix = "BISON_";
-  char *macro_name, *cp;
-
-  if (spec_defines_file)
-    {
-      macro_name = XMALLOC (char,
-                           strlen (prefix) +
-                           strlen (spec_defines_file) + 1);
-      cp = stpcpy (macro_name, prefix);
-      cp = stpcpy (cp, spec_defines_file);
-    }
-  else
-    {
-      macro_name = XMALLOC (char,
-                           strlen (prefix) +
-                           strlen (full_base_name) +
-                           strlen (header_extension) + 1);
-      cp = stpcpy (macro_name, prefix);
-      cp = stpcpy (cp, full_base_name);
-      cp = stpcpy (cp, header_extension);
-    }
-
-  for (cp = macro_name; *cp; ++cp)
-    if (islower (*cp))
-      *cp = toupper (*cp);
-    else if (!isalnum (*cp))
-      *cp = '_';
-
-  return macro_name;
-}
-
-
 /*-----------------------------------------------------------------.
 | Try to open file NAME with mode MODE, and print an error message |
 | if fails.                                                        |
diff -pru .del/bison2/src/files.h bison/src/files.h
--- .del/bison2/src/files.h     2002-06-14 10:36:24.000000000 -0700
+++ bison/src/files.h   2002-08-12 07:38:04.000000000 -0700
@@ -57,9 +57,6 @@ void compute_output_file_names PARAMS((v
 FILE *xfopen PARAMS ((const char *name, const char *mode));
 int xfclose PARAMS ((FILE *ptr));
 
-/* Compute the double inclusion guard's name. */
-char *compute_header_macro PARAMS ((void));
-
 const char *skeleton_find PARAMS ((const char *envvar,
                                   const char *skeleton_name));
 
diff -pru .del/bison2/src/gram.c bison/src/gram.c
--- .del/bison2/src/gram.c      2002-08-02 01:05:01.000000000 -0700
+++ bison/src/gram.c    2002-08-12 07:39:16.000000000 -0700
@@ -247,10 +247,10 @@ grammar_dump (FILE *out, const char *tit
           ntokens, nvars, nsyms, nrules, nritems);
 
 
-  fprintf (out, "Variables\n---------\n\n");
+  fprintf (out, _("Variables\n---------\n\n"));
   {
     symbol_number_t i;
-    fprintf (out, "Value  Sprec  Sassoc  Tag\n");
+    fprintf (out, _("Value  Sprec  Sassoc  Tag\n"));
 
     for (i = ntokens; i < nsyms; i++)
       fprintf (out, "%5d  %5d   %5d  %s\n",
@@ -260,25 +260,26 @@ grammar_dump (FILE *out, const char *tit
     fprintf (out, "\n\n");
   }
 
-  fprintf (out, "Rules\n-----\n\n");
+  fprintf (out, _("Rules\n-----\n\n"));
   {
     rule_number_t i;
-    fprintf (out, "Num (Prec, Assoc, Useful, Ritem Range) Lhs -> Rhs (Ritem 
range) [Num]\n");
+    fprintf (out, _("Num (Prec, Assoc, Useful, Ritem Range) Lhs -> Rhs (Ritem 
range) [Num]\n"));
     for (i = 0; i < nrules + nuseless_productions; i++)
       {
        rule_t *rule = &rules[i];
        item_number_t *r = NULL;
-       int rhs_count = 0;
+       unsigned int rhs_itemno = rule->rhs - ritem;
+       unsigned int rhs_count = 0;
        /* Find the last RHS index in ritems. */
        for (r = rule->rhs; *r >= 0; ++r)
          ++rhs_count;
-       fprintf (out, "%3d (%2d, %2d, %2d, %2d-%2d)   %2d ->",
+       fprintf (out, "%3d (%2d, %2d, %2d, %2u-%2u)   %2d ->",
                 i,
                 rule->prec ? rule->prec->prec : 0,
                 rule->prec ? rule->prec->assoc : 0,
                 rule->useful,
-                rule->rhs - ritem,
-                rule->rhs - ritem + rhs_count - 1,
+                rhs_itemno,
+                rhs_itemno + rhs_count - 1,
                 rule->lhs->number);
        /* Dumped the RHS. */
        for (r = rule->rhs; *r >= 0; r++)
@@ -288,7 +289,7 @@ grammar_dump (FILE *out, const char *tit
   }
   fprintf (out, "\n\n");
 
-  fprintf (out, "Rules interpreted\n-----------------\n\n");
+  fprintf (out, _("Rules interpreted\n-----------------\n\n"));
   {
     rule_number_t r;
     for (r = 0; r < nrules + nuseless_productions; r++)
diff -pru .del/bison2/src/injections.c bison/src/injections.c
--- .del/bison2/src/injections.c        2002-07-31 12:49:52.000000000 -0700
+++ bison/src/injections.c      2002-08-12 07:40:07.000000000 -0700
@@ -101,10 +101,10 @@ injections_compute (void)
       }
 
   if (trace_flag & trace_sets)
-    injections_print ("syntactic direct injections");
+    injections_print (_("syntactic direct injections"));
   bitsetv_transitive_closure (injects);
   if (trace_flag & trace_sets)
-    injections_print ("syntactic injections");
+    injections_print (_("syntactic injections"));
 }
 
 
diff -pru .del/bison2/src/lalr.c bison/src/lalr.c
--- .del/bison2/src/lalr.c      2002-08-01 11:14:30.000000000 -0700
+++ bison/src/lalr.c    2002-08-12 07:40:55.000000000 -0700
@@ -403,7 +403,7 @@ lookaheads_print (FILE *out)
 {
   state_number_t i;
   int j, k;
-  fprintf (out, "Lookaheads: BEGIN\n");
+  fprintf (out, _("Lookaheads: BEGIN\n"));
   for (i = 0; i < nstates; ++i)
     {
       reductions_t *reds = states[i]->reductions;
@@ -415,19 +415,19 @@ lookaheads_print (FILE *out)
          if (reds->lookaheads[k])
            ++nlookaheads;
 
-      fprintf (out, "State %d: %d lookaheads\n",
+      fprintf (out, _("State %d: %d lookaheads\n"),
               i, nlookaheads);
 
       if (reds->lookaheads)
        for (j = 0; j < reds->num; ++j)
          BITSET_FOR_EACH (iter, reds->lookaheads[j], k, 0)
          {
-           fprintf (out, "   on %d (%s) -> rule %d\n",
+           fprintf (out, _("   on %d (%s) -> rule %d\n"),
                     k, symbols[k]->tag,
                     reds->rules[j]->number);
          };
     }
-  fprintf (out, "Lookaheads: END\n");
+  fprintf (out, _("Lookaheads: END\n"));
 }
 
 void
diff -pru .del/bison2/src/LR0.c bison/src/LR0.c
--- .del/bison2/src/LR0.c       2002-07-31 12:49:52.000000000 -0700
+++ bison/src/LR0.c     2002-08-12 07:33:12.000000000 -0700
@@ -1,5 +1,7 @@
 /* Generate the nondeterministic finite state machine for bison,
-   Copyright 1984, 1986, 1989, 2000, 2001, 2002  Free Software Foundation, Inc.
+
+   Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002 Free Software
+   Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -60,7 +62,7 @@ state_list_append (symbol_number_t symbo
   state_t *state = state_new (symbol, core_size, core);
 
   if (trace_flag & trace_automaton)
-    fprintf (stderr, "state_list_append (state = %d, symbol = %d (%s))\n",
+    fprintf (stderr, _("state_list_append (state = %d, symbol = %d (%s))\n"),
             nstates, symbol, symbols[symbol]->tag);
 
   /* If this is the endtoken, and this is not the initial state, then
@@ -178,7 +180,7 @@ new_itemsets (state_t *state)
   int i;
 
   if (trace_flag & trace_automaton)
-    fprintf (stderr, "Entering new_itemsets, state = %d\n",
+    fprintf (stderr, _("Entering new_itemsets, state = %d\n"),
             state->number);
 
   for (i = 0; i < nsyms; i++)
@@ -216,7 +218,7 @@ get_state (symbol_number_t symbol, size_
   state_t *sp;
 
   if (trace_flag & trace_automaton)
-    fprintf (stderr, "Entering get_state, symbol = %d (%s)\n",
+    fprintf (stderr, _("Entering get_state, symbol = %d (%s)\n"),
             symbol, symbols[symbol]->tag);
 
   sp = state_hash_lookup (core_size, core);
@@ -224,7 +226,7 @@ get_state (symbol_number_t symbol, size_
     sp = state_list_append (symbol, core_size, core);
 
   if (trace_flag & trace_automaton)
-    fprintf (stderr, "Exiting get_state => %d\n", sp->number);
+    fprintf (stderr, _("Exiting get_state => %d\n"), sp->number);
 
   return sp;
 }
@@ -244,7 +246,7 @@ append_states (state_t *state)
   symbol_number_t symbol;
 
   if (trace_flag & trace_automaton)
-    fprintf (stderr, "Entering append_states, state = %d\n",
+    fprintf (stderr, _("Entering append_states, state = %d\n"),
             state->number);
 
   /* first sort shift_symbol into increasing order */
@@ -352,7 +354,7 @@ generate_states (void)
     {
       state_t *state = list->state;
       if (trace_flag & trace_automaton)
-       fprintf (stderr, "Processing state %d (reached by %s)\n",
+       fprintf (stderr, _("Processing state %d (reached by %s)\n"),
                 state->number,
                 symbols[state->accessing_symbol]->tag);
       /* Set up ruleset and itemset for the transitions out of this
diff -pru .del/bison2/src/main.c bison/src/main.c
--- .del/bison2/src/main.c      2002-08-02 01:05:01.000000000 -0700
+++ bison/src/main.c    2002-08-12 07:41:48.000000000 -0700
@@ -51,8 +51,8 @@ main (int argc, char *argv[])
 {
   program_name = argv[0];
   setlocale (LC_ALL, "");
-  bindtextdomain (PACKAGE, LOCALEDIR);
-  textdomain (PACKAGE);
+  (void) bindtextdomain (PACKAGE, LOCALEDIR);
+  (void) textdomain (PACKAGE);
 
   getargs (argc, argv);
 
diff -pru .del/bison2/src/Makefile.am bison/src/Makefile.am
--- .del/bison2/src/Makefile.am 2002-07-31 14:52:00.000000000 -0700
+++ bison/src/Makefile.am       2002-08-12 07:33:54.000000000 -0700
@@ -24,11 +24,8 @@ DEFS = @DEFS@ \
 CFLAGS = @CFLAGS@ $(WARNING_CFLAGS) $(WERROR_CFLAGS)
 YFLAGS = "-dv"
 
-# libintl.h in is build/intl, intl/libgettext.h in src/,
-# config.h in build/.
-INCLUDES = -I$(top_builddir)/intl \
-           -I$(top_builddir)      \
-           -I$(top_srcdir)/intl \
+# config.h is in build/.
+INCLUDES = -I$(top_builddir)      \
            -I$(top_srcdir)/lib
 
 LDADD = $(INTLLIBS) ../lib/libbison.a
diff -pru .del/bison2/src/parse-gram.y bison/src/parse-gram.y
--- .del/bison2/src/parse-gram.y        2002-07-25 23:25:35.000000000 -0700
+++ bison/src/parse-gram.y      2002-08-12 07:49:45.000000000 -0700
@@ -94,7 +94,7 @@ braced_code_t current_braced_code = acti
   assoc_t assoc;
 };
 
-/* Define the tokens together with there human representation. */
+/* Define the tokens together with their human representation.  */
 %token GRAM_EOF 0 "end of string"
 %token STRING CHARACTER
 %token INT
diff -pru .del/bison2/src/relation.c bison/src/relation.c
--- .del/bison2/src/relation.c  2002-07-31 12:49:52.000000000 -0700
+++ bison/src/relation.c        2002-08-12 07:50:38.000000000 -0700
@@ -134,7 +134,7 @@ relation_transpose (relation_t *R_arg, i
 
   if (trace_flag & trace_sets)
     {
-      fputs ("relation_transpose: input\n", stderr);
+      fputs (_("relation_transpose: input\n"), stderr);
       relation_print (*R_arg, n, stderr);
     }
 
@@ -173,7 +173,7 @@ relation_transpose (relation_t *R_arg, i
 
   if (trace_flag & trace_sets)
     {
-      fputs ("relation_transpose: output\n", stderr);
+      fputs (_("relation_transpose: output\n"), stderr);
       relation_print (new_R, n, stderr);
     }
 
diff -pru .del/bison2/src/scan-gram.l bison/src/scan-gram.l
--- .del/bison2/src/scan-gram.l 2002-07-19 01:31:32.000000000 -0700
+++ bison/src/scan-gram.l       2002-08-12 07:52:47.000000000 -0700
@@ -167,10 +167,10 @@ blanks   [ \t\f]+
   {int}       yylval->integer = strtol (yytext, 0, 10); return INT;
 
   /* Characters.  We don't check there is only one.  */
-  \'          YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);
+  "'"         YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);
 
   /* Strings. */
-  \"          YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);
+  "\""        YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);
 
   /* Comments. */
   "/*"        yy_push_state (SC_COMMENT);
@@ -199,7 +199,7 @@ blanks   [ \t\f]+
 
   .           {
     LOCATION_PRINT (stderr, *yylloc);
-    fprintf (stderr, ": invalid character: `%c'\n", *yytext);
+    fprintf (stderr, _(": invalid character: `%c'\n"), *yytext);
     YY_STEP;
   }
 }
@@ -243,7 +243,7 @@ blanks   [ \t\f]+
 
   <<EOF>> {
     LOCATION_PRINT (stderr, *yylloc);
-    fprintf (stderr, ": unexpected end of file in a comment\n");
+    fprintf (stderr, _(": unexpected end of file in a comment\n"));
     yy_pop_state ();
   }
 }
@@ -256,7 +256,7 @@ blanks   [ \t\f]+
 
 <SC_ESCAPED_STRING>
 {
-  \" {
+  "\"" {
     assert (yy_top_state () == INITIAL);
     YY_OBS_GROW;
     YY_OBS_FINISH;
@@ -271,7 +271,7 @@ blanks   [ \t\f]+
 
   <<EOF>> {
     LOCATION_PRINT (stderr, *yylloc);
-    fprintf (stderr, ": unexpected end of file in a string\n");
+    fprintf (stderr, _(": unexpected end of file in a string\n"));
     assert (yy_top_state () == INITIAL);
     YY_OBS_FINISH;
     yylval->string = last_string;
@@ -287,7 +287,7 @@ blanks   [ \t\f]+
 
 <SC_ESCAPED_CHARACTER>
 {
-  \' {
+  "'" {
     YY_OBS_GROW;
     assert (yy_top_state () == INITIAL);
     {
@@ -302,13 +302,13 @@ blanks   [ \t\f]+
     }
   }
 
-  [^\'\n\r\\]      YY_OBS_GROW;
+  [^\n\r\\] YY_OBS_GROW;
 
   {eols}    obstack_1grow (&string_obstack, '\n'); YY_LINES;
 
   <<EOF>> {
     LOCATION_PRINT (stderr, *yylloc);
-    fprintf (stderr, ": unexpected end of file in a character\n");
+    fprintf (stderr, _(": unexpected end of file in a character\n"));
     assert (yy_top_state () == INITIAL);
     YY_OBS_FINISH;
     yylval->string = last_string;
@@ -329,7 +329,7 @@ blanks   [ \t\f]+
     if (c > 255)
       {
        LOCATION_PRINT (stderr, *yylloc);
-       fprintf (stderr, ": invalid escape: %s\n", quote (yytext));
+       fprintf (stderr, _(": invalid escape: %s\n"), quote (yytext));
        YY_STEP;
       }
     else
@@ -350,7 +350,7 @@ blanks   [ \t\f]+
   \\[\\""]   obstack_1grow (&string_obstack, yytext[1]);
   \\(.|\n)     {
     LOCATION_PRINT (stderr, *yylloc);
-    fprintf (stderr, ": unrecognized escape: %s\n", quote (yytext));
+    fprintf (stderr, _(": unrecognized escape: %s\n"), quote (yytext));
     YY_OBS_GROW;
   }
   /* FLex wants this rule, in case of a `\<<EOF>>'. */
@@ -365,7 +365,7 @@ blanks   [ \t\f]+
 
 <SC_CHARACTER>
 {
-  \' {
+  "'" {
     YY_OBS_GROW;
     assert (yy_top_state () != INITIAL);
     yy_pop_state ();
@@ -380,7 +380,7 @@ blanks   [ \t\f]+
 
   <<EOF>> {
     LOCATION_PRINT (stderr, *yylloc);
-    fprintf (stderr, ": unexpected end of file in a character\n");
+    fprintf (stderr, _(": unexpected end of file in a character\n"));
     assert (yy_top_state () != INITIAL);
     yy_pop_state ();
   }
@@ -394,7 +394,7 @@ blanks   [ \t\f]+
 
 <SC_STRING>
 {
-  \" {
+  "\"" {
     assert (yy_top_state () != INITIAL);
     YY_OBS_GROW;
     yy_pop_state ();
@@ -409,7 +409,7 @@ blanks   [ \t\f]+
 
   <<EOF>> {
     LOCATION_PRINT (stderr, *yylloc);
-    fprintf (stderr, ": unexpected end of file in a string\n");
+    fprintf (stderr, _(": unexpected end of file in a string\n"));
     assert (yy_top_state () != INITIAL);
     yy_pop_state ();
   }
@@ -423,10 +423,10 @@ blanks   [ \t\f]+
 <SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>
 {
   /* Characters.  We don't check there is only one.  */
-  \'          YY_OBS_GROW; yy_push_state (SC_CHARACTER);
+  "'"         YY_OBS_GROW; yy_push_state (SC_CHARACTER);
 
   /* Strings. */
-  \"          YY_OBS_GROW; yy_push_state (SC_STRING);
+  "\""        YY_OBS_GROW; yy_push_state (SC_STRING);
 
   /* Comments. */
   "/*"        YY_OBS_GROW; yy_push_state (SC_COMMENT);
@@ -470,7 +470,7 @@ blanks   [ \t\f]+
 
   <<EOF>> {
     LOCATION_PRINT (stderr, *yylloc);
-    fprintf (stderr, ": unexpected end of file in a braced code\n");
+    fprintf (stderr, _(": unexpected end of file in a braced code\n"));
     yy_pop_state ();
     YY_OBS_FINISH;
     yylval->string = last_string;
@@ -499,7 +499,7 @@ blanks   [ \t\f]+
 
   <<EOF>> {
     LOCATION_PRINT (stderr, *yylloc);
-    fprintf (stderr, ": unexpected end of file in a prologue\n");
+    fprintf (stderr, _(": unexpected end of file in a prologue\n"));
     yy_pop_state ();
     YY_OBS_FINISH;
     yylval->string = last_string;
@@ -564,7 +564,7 @@ handle_action_dollar (char *text, locati
       obstack_fgrow1 (&string_obstack,
                      "]b4_lhs_value([%s])[", type_name);
     }
-  else if (isdigit (*cp) || *cp == '-')
+  else if (('0' <= *cp && *cp <= '9') || *cp == '-')
     {
       /* RULE_LENGTH is the number of values in the current rule so
         far, which says where to find `$0' with respect to the top of
@@ -651,7 +651,7 @@ handle_action_at (char *text, location_t
     {
       obstack_sgrow (&string_obstack, "]b4_lhs_location[");
     }
-  else if (isdigit (*cp) || *cp == '-')
+  else if (('0' <= *cp && *cp <= '9') || *cp == '-')
     {
       /* RULE_LENGTH is the number of values in the current rule so
         far, which says where to find `$0' with respect to the top of
diff -pru .del/bison2/src/symtab.c bison/src/symtab.c
--- .del/bison2/src/symtab.c    2002-07-29 10:30:33.000000000 -0700
+++ bison/src/symtab.c  2002-08-12 07:53:26.000000000 -0700
@@ -421,7 +421,7 @@ symbol_get (const char *key, location_t 
 
   /* Keep the symbol in a printable form.  */
   key = quotearg_style (escape_quoting_style, key);
-  (const char *) probe.tag = key;
+  *(char const **) &probe.tag = key;
   entry = hash_lookup (symbol_table, &probe);
 
   if (!entry)
diff -pru .del/bison2/src/system.h bison/src/system.h
--- .del/bison2/src/system.h    2002-07-31 12:52:13.000000000 -0700
+++ bison/src/system.h  2002-08-12 07:54:27.000000000 -0700
@@ -1,5 +1,5 @@
 /* system-dependent definitions for Bison.
-   Copyright 2000, 2001, 2002  Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002 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
@@ -22,6 +22,23 @@
 # include <config.h>
 #endif
 
+/* AIX requires this to be the first thing in the file.  */
+#ifdef __GNUC__
+# define alloca(Size) __builtin_alloca (Size)
+#else
+# if HAVE_ALLOCA_H
+#  include <alloca.h>
+# else
+#  ifdef _AIX
+ #pragma alloca
+#  else
+#   ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+#   endif
+#  endif
+# endif
+#endif
+
 #include <stdio.h>
 
 #include <assert.h>
@@ -57,30 +74,11 @@
 /* memory.h and strings.h conflict on some systems.  */
 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
 
-#if defined(STDC_HEADERS) || defined(HAVE_CTYPE_H)
-# include <ctype.h>
-#endif
-
 #include <errno.h>
 #ifndef errno
 extern int errno;
 #endif
 
-/* AIX requires this to be the first thing in the file.  */
-#ifndef __GNUC__
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifdef _AIX
- #pragma alloca
-#  else
-#   ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-#   endif
-#  endif
-# endif
-#endif
-
 #ifndef PARAMS
 # if defined PROTOTYPES || defined __STDC__
 #  define PARAMS(Args) Args
@@ -104,11 +102,6 @@ char *alloca ();
 /* From xstrndup.c.  */
 char *xstrndup PARAMS ((const char *s, size_t n));
 
-/* Finding `mallinfo' where available.  */
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-
 
 /*----------------.
 | Using timevar.  |
diff -pru .del/bison2/src/tables.c bison/src/tables.c
--- .del/bison2/src/tables.c    2002-08-02 01:05:01.000000000 -0700
+++ bison/src/tables.c  2002-08-12 07:55:23.000000000 -0700
@@ -207,8 +207,8 @@ table_grow (size_t desired)
     table_size *= 2;
 
   if (trace_flag & trace_resource)
-    fprintf (stderr, "growing table and check from: %d to %d\n",
-            old_size, table_size);
+    fprintf (stderr, _("growing table and check from: %lu to %lu\n"),
+            (unsigned long) old_size, (unsigned long) table_size);
 
   table = XREALLOC (table, base_t, table_size);
   check = XREALLOC (check, base_t, table_size);
@@ -754,7 +754,7 @@ pack_vector (vector_number_t vector)
            high = loc;
 
          if (j < BASE_MIN || BASE_MAX < j)
-           fatal ("base_t too small to hold %d\n", j);
+           fatal (_("base_t too small to hold %d\n"), j);
          return j;
        }
     }
diff -pru .del/bison2/tests/cxx-type.at bison/tests/cxx-type.at
--- .del/bison2/tests/cxx-type.at       2002-06-30 10:35:06.000000000 -0700
+++ bison/tests/cxx-type.at     2002-08-12 07:57:12.000000000 -0700
@@ -1,5 +1,5 @@
 # Checking GLR Parsing.                         -*- Autotest -*-
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002 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
@@ -128,7 +128,7 @@ yylex ()
        ungetc (c, stdin);
        scanf ("%[A-Za-z0-9_]", buffer);
        yylval = strdup (buffer);
-       return isupper (buffer[0]) ? TYPENAME : ID;
+       return isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
       }
       return c;
     }
diff -pru .del/bison2/tests/Makefile.am bison/tests/Makefile.am
--- .del/bison2/tests/Makefile.am       2002-06-27 19:26:44.000000000 -0700
+++ bison/tests/Makefile.am     2002-08-12 07:56:24.000000000 -0700
@@ -1,7 +1,7 @@
 ## Process this file with automake to create Makefile.in.
 
 ## Makefile for Bison testsuite.
-## Copyright (C) 2000, 2001, 2002  Free Software Foundation, Inc.
+## Copyright (C) 2000, 2001, 2002 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
@@ -18,7 +18,7 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
-EXTRA_DIST = $(TESTSUITE_AT) testsuite
+EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4
 
 DISTCLEANFILES       = atconfig $(check_SCRIPTS)
 MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
@@ -37,8 +37,6 @@ $(srcdir)/package.m4: $(top_srcdir)/conf
          echo 'm4_define([AT_PACKAGE_BUGREPORT], address@hidden@])'; \
        } >$(srcdir)/package.m4
 
-EXTRA_DIST += package.m4
-
 ## ------------ ##
 ## Test suite.  ##
 ## ------------ ##
diff -pru .del/bison2/tests/regression.at bison/tests/regression.at
--- .del/bison2/tests/regression.at     2002-07-30 04:06:50.000000000 -0700
+++ bison/tests/regression.at   2002-08-12 07:58:16.000000000 -0700
@@ -51,7 +51,7 @@ exp: MY_TOKEN;
 ]])
 
 AT_CHECK([bison input.y -o input.c])
-AT_COMPILE([input], [-c input.c])
+AT_COMPILE([input.o], [-c input.c])
 
 AT_CLEANUP
 
@@ -328,7 +328,7 @@ exp: "a";
 ]])
 
 AT_CHECK([bison input.y -o input.c])
-AT_COMPILE([input], [input.c -c])
+AT_COMPILE([input.o], [-c input.c])
 AT_CLEANUP
 
 
diff -pru .del/bison2/tests/synclines.at bison/tests/synclines.at
--- .del/bison2/tests/synclines.at      2002-07-09 03:06:20.000000000 -0700
+++ bison/tests/synclines.at    2002-08-12 07:59:02.000000000 -0700
@@ -24,7 +24,7 @@ AT_BANNER([[User Actions.]])
 # Compile FILE expecting an error, and save in the file stdout the normalized
 # output.
 m4_define([AT_SYNCLINES_COMPILE],
-[AT_CHECK([$CC $CFLAGS $CPPFLAGS $1 -c], 1, [], [stderr])
+[AT_CHECK([$CC $CFLAGS $CPPFLAGS -c $1 || (exit 1)], 1, [], [stderr])
 # In case GCC displays column information, strip it down.
 #
 #   input.y:4:2: #error "4"    or input.y:4.2: #error "4"
diff -pru .del/bison2/tests/torture.at bison/tests/torture.at
--- .del/bison2/tests/torture.at        2002-06-30 10:35:06.000000000 -0700
+++ bison/tests/torture.at      2002-08-12 07:59:47.000000000 -0700
@@ -19,6 +19,19 @@
 AT_BANNER([[Torture Tests.]])
 
 
+# AT_INCREASE_DATA_SIZE(SIZE)
+# -------------------------------------------
+# Try to increase the data size to SIZE KiB if possible.
+m4_define([AT_INCREASE_DATA_SIZE],
+[data_limit=`(ulimit -S -d) 2>/dev/null`
+case $data_limit in
+[[0-9]]*)
+  if test "$data_limit" -lt $1; then
+    ulimit -S -d $1
+  fi
+esac])
+
+
 ## ------------------------------------- ##
 ## Creating a large artificial grammar.  ##
 ## ------------------------------------- ##
@@ -230,6 +243,11 @@ AT_SETUP([Big horizontal])
 # ./input                          0.00s user 0.01s sys 108% cpu     0.01 total
 #
 AT_DATA_HORIZONTAL_GRAMMAR([input.y], [1000])
+
+# GNU m4 requires about 70 MiB for this test on a 32-bit host.
+# Ask for 200 MiB, which should be plenty even on a 64-bit host.
+AT_INCREASE_DATA_SIZE(204000)
+
 AT_CHECK([bison input.y -v -o input.c])
 AT_COMPILE([input])
 AT_PARSER_CHECK([./input])
@@ -349,6 +367,11 @@ mv stdout $1
 AT_SETUP([Many lookaheads])
 
 AT_DATA_LOOKAHEADS_GRAMMAR([input.y], [1000])
+
+# GNU m4 requires about 70 MiB for this test on a 32-bit host.
+# Ask for 200 MiB, which should be plenty even on a 64-bit host.
+AT_INCREASE_DATA_SIZE(204000)
+
 AT_CHECK([bison input.y -v -o input.c])
 AT_COMPILE([input])
 AT_PARSER_CHECK([./input])




reply via email to

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