]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
AC_PROG_YACC: don't force Bison to warn against its own features
authorAkim Demaille <akim@lrde.epita.fr>
Tue, 19 Mar 2013 18:19:17 +0000 (11:19 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Mar 2013 18:19:40 +0000 (11:19 -0700)
When invoked with -y/--yacc, Bison warns when its extensions over
POSIX Yacc are used.  Yet many packages requiring GNU Bison use
Autoconf/Automake's Yacc support, which passes -y to Bison.  It
turns out that passing '-o y.tab.c' has exactly the desired
effect: generating not only y.tab.c but also y.tab.h with -d and
y.output with -v.  See:
http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00100.html
* lib/autoconf/programs.m4 (AC_PROG_YACC): Use bison -o y.tab.c.
* NEWS, doc/autoconf.texi: Document this change.

NEWS
doc/autoconf.texi
lib/autoconf/programs.m4

diff --git a/NEWS b/NEWS
index 1780cb9ad3c7fc4d6d09b0980737f16b2c751f05..de9d9154e5be462553b94243b1b95c4b71a1e810 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,10 @@ GNU Autoconf NEWS - User visible changes.
 - AC_PROG_CC_STDC, AC_PROG_CC_C89, AC_PROG_CC_C99 have been marked as obsolete.
   Applications should use AC_PROG_CC.
 
+- AC_PROG_YACC now uses 'bison -o y.tab.c' instead of 'bison -y', so that
+  by default it no longer warns about Bison extensions.  Add -Wyacc to
+  YFLAGS to enable these warnings.
+
 - AC_USE_SYSTEM_EXTENSIONS now enables more system extensions on HP-UX,
   MINIX 3, and OS X.
 
index c54c5b351a2a33f61928fdba78208d6cdbbcff40..f895e4797e6fed271e5477f59daa6c35a4d3380d 100644 (file)
@@ -4222,7 +4222,7 @@ and is cached in the @code{ac_cv_path_SED} variable.
 @ovindex YACC
 @caindex prog_YACC
 If @code{bison} is found, set output variable @code{YACC} to @samp{bison
--y}.  Otherwise, if @code{byacc} is found, set @code{YACC} to
+-o y.tab.c}.  Otherwise, if @code{byacc} is found, set @code{YACC} to
 @samp{byacc}.  Otherwise set @code{YACC} to @samp{yacc}.
 The result of this test can be influenced by setting the variable
 @code{YACC} or the cache variable @code{ac_cv_prog_YACC}.
index f7af8b545250fe276983f189f262515d528c71b8..2057e78563475f9ed7122a79ab38fff11d2eec81 100644 (file)
@@ -892,10 +892,10 @@ AN_PROGRAM([yacc],  [AC_PROG_YACC])
 AN_PROGRAM([byacc], [AC_PROG_YACC])
 AN_PROGRAM([bison], [AC_PROG_YACC])
 AC_DEFUN([AC_PROG_YACC],
-[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)dnl
+[AC_CHECK_PROGS(YACC, 'bison -o y.tab.c' byacc, yacc)dnl
 AC_ARG_VAR(YACC,
 [The `Yet Another Compiler Compiler' implementation to use.  Defaults to
-the first program found out of: `bison -y', `byacc', `yacc'.])dnl
+the first program found out of: `bison -o y.tab.c', `byacc', `yacc'.])dnl
 AC_ARG_VAR(YFLAGS,
 [The list of arguments that will be passed by default to $YACC.  This script
 will default YFLAGS to the empty string to avoid a default value of `-d' given