From: Akim Demaille Date: Thu, 19 Jul 2012 15:32:01 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/maint' X-Git-Tag: v2.7.90~400 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/3eb4f1a3e62807125a815dc572da9204b5b51865 Merge remote-tracking branch 'origin/maint' * origin/maint: maint: update gnu-web-doc-update. maint: post-release administrivia version 2.6 maint: prepare for release 2.6 maint: post-release administrivia version 2.5.91 maint: prepare NEWS. maint: fix spaces. tests: adjust to case where the C compiler is actually a C++ compiler tests: fix dependencies doc: fix Texinfo command maint: Valgrind on OS X. tests: be sure that backups are safe. maint: dead comment. tests: refactor for legibility. tests: refactor the bison invocations. maint: fix syntax-check ignore patterns. gnulib: update gnulib: update. gnulib: update Conflicts: build-aux/Makefile.am cfg.mk tests/Makefile.am --- 3eb4f1a3e62807125a815dc572da9204b5b51865 diff --cc NEWS index 0552ba21,be9ed7ca..8db03d60 --- a/NEWS +++ b/NEWS @@@ -2,129 -2,10 +2,129 @@@ GNU Bison NEW * Noteworthy changes in release ?.? (????-??-??) [?] +** Warnings + +*** Warning categories are now displayed in warnings + + For instance: + + foo.y:4.6: warning: type clash on default action: != [-Wother] + +*** Useless semantic types + + Bison now warns about useless (uninhabited) semantic types. Since + semantic types are not declared to Bison (they are defined in the opaque + %union structure), it is %printer/%destructor directives about useless + types that trigger the warning: + + %token term + %type nterm + %printer {} + %destructor {} + %% + nterm: term { $$ = $1; }; + + 3.28-34: warning: type is used, but is not associated to any symbol + 4.28-34: warning: type is used, but is not associated to any symbol + +*** Undeclared symbols + + Bison used to raise an error for %printer and %destructor directives for + undefined symbols. + + %printer {} symbol1 + %destructor {} symbol2 + %% + exp: "a"; + + This is now only a warning. + +*** Useless destructors or printers + + Bison now warns about useless destructors or printers. In the following + example, the printer for , and the destructor for are + useless: all symbols of (token1) already have a printer, and all + symbols of type (token2) already have a destructor. + + %token token1 + token2 + token3 + token4 + %printer {} token1 + %destructor {} token2 + +** Additional yylex/yyparse arguments + + The new directive %param declares additional arguments to both yylex and + yyparse. The %lex-param, %parse-param, and %param directives support one + or more arguments. Instead of + + %lex-param {arg1_type *arg1} + %lex-param {arg2_type *arg2} + %parse-param {arg1_type *arg1} + %parse-param {arg2_type *arg2} + + one may now declare + + %param {arg1_type *arg1} {arg2_type *arg2} + +** Java skeleton improvements + + The constants for token names were moved to the Lexer interface. + Also, it is possible to add code to the parser's constructors using + "%code init" and "%define init_throws". + +** C++ skeleton improvements + + The C++ parser features a syntax_error exception, which can be + thrown from the scanner or from user rules to raise syntax errors. + This facilitates reporting errors caught in sub-functions (e.g., + rejecting too large integral literals from a conversion function + used by the scanner, or rejecting invalid combinations from a + factory invoked by the user actions). + +** Variable api.tokens.prefix + + The variable api.tokens.prefix changes the way tokens are identified in + the generated files. This is especially useful to avoid collisions + with identifiers in the target language. For instance + + %token FILE for ERROR + %define api.tokens.prefix "TOK_" + %% + start: FILE for ERROR; + + will generate the definition of the symbols TOK_FILE, TOK_for, and + TOK_ERROR in the generated sources. In particular, the scanner must + use these prefixed token names, although the grammar itself still + uses the short names (as in the sample rule given above). + +** Variable api.namespace + + The "namespace" variable is renamed "api.namespace". Backward + compatibility is ensured, but upgrading is recommended. + +** Variable parse.error + + The variable error controls the verbosity of error messages. The + use of the %error-verbose directive is deprecated in favor of + %define parse.error "verbose". + +** Semantic predicates + + The new, experimental, semantic-predicate feature allows actions of + the form %?{ BOOLEAN-EXPRESSION }, which cause syntax errors (as for + YYERROR) if the expression evaluates to 0, and are evaluated immediately + in GLR parsers, rather than being deferred. The result is that they + allow the programmer to prune possible parses based on the values of + run-time expressions. + +* Noteworthy changes in release ?.? (????-??-??) [?] + - * Noteworthy changes in release 2.5.90 (2012-07-05) [beta] + * Noteworthy changes in release 2.6 (2012-07-19) [stable] -** Future Changes +** Future changes: The next major release of Bison will drop support for the following deprecated features. Please report disagreements to bug-bison@gnu.org. diff --cc bootstrap index e9849102,e00c8bbb..e3e270b0 --- a/bootstrap +++ b/bootstrap @@@ -1,6 -1,6 +1,6 @@@ #! /bin/sh # Print a version string. - scriptversion=2012-07-03.20; # UTC -scriptversion=2012-07-10.09; # UTC ++scriptversion=2012-07-19.14; # UTC # Bootstrap this package from checked-out sources. @@@ -186,6 -214,6 +214,8 @@@ use_git=tru # otherwise find the first of the NAMES that can be run (i.e., # supports --version). If found, set ENVVAR to the program name, # die otherwise. ++# ++# FIXME: code duplication, see also gnu-web-doc-update. find_tool () { find_tool_envvar=$1 diff --cc build-aux/local.mk index 29c907a4,00000000..7daf6cf7 mode 100644,000000..100644 --- a/build-aux/local.mk +++ b/build-aux/local.mk @@@ -1,5 -1,0 +1,23 @@@ ++## Makefile for Bison testsuite. ++ ++# Copyright (C) 2000-2012 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 ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# 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, see . ++ +EXTRA_DIST += \ + build-aux/cross-options.pl \ ++ build-aux/darwin11.4.0.valgrind \ + build-aux/move-if-change \ + build-aux/prev-version.txt \ + build-aux/update-b4-copyright diff --cc cfg.mk index 9e9f8065,2f1a9e94..f1caf313 --- a/cfg.mk +++ b/cfg.mk @@@ -62,9 -69,10 +63,10 @@@ $(call exclude, prohibit_always-defined_macros+=?|^lib/timevar.c$$ \ prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \ prohibit_always-defined_macros+=?|^tests/regression.at$$ \ + prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \ - prohibit_empty_lines_at_EOF=^src/parse-gram.[ch]$$ \ + prohibit_empty_lines_at_EOF=^src/parse-gram.h$$ \ + prohibit_strcmp=^doc/bison\.texi$$ \ require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \ space_tab=^tests/(input|c\+\+)\.at$$ \ - trailing_blank=^src/parse-gram.[ch]$$ \ unmarked_diagnostics=^(djgpp/|doc/bison.texi$$) \ ) diff --cc configure.ac index 0facd4ab,2773167a..cf42d2c6 --- a/configure.ac +++ b/configure.ac @@@ -167,9 -160,19 +167,19 @@@ AC_CONFIG_FILES([etc/bench.pl], [chmod # Initialize the test suite. AC_CONFIG_TESTDIR(tests) -AC_CONFIG_FILES([tests/Makefile tests/atlocal]) +AC_CONFIG_FILES([tests/atlocal]) AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison]) AC_CHECK_PROGS([VALGRIND], [valgrind]) + case $VALGRIND:$host_os in + '':*) ;; + *:darwin*) + # See README-hacking. + # VALGRIND+=' --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind' + VALGRIND=;; + *:*) + AC_SUBST([VALGRIND_PREBISON], [$VALGRIND -q]);; + esac + AM_MISSING_PROG([AUTOM4TE], [autom4te]) # Needed by tests/atlocal.in. AC_SUBST([GCC]) diff --cc tests/local.at index 5d318ba7,2dbbfc71..c79fc08e --- a/tests/local.at +++ b/tests/local.at @@@ -434,77 -444,88 +447,88 @@@ AT_BISON_CHECK_NO_XML($@)] m4_define([AT_BISON_WERROR_MSG], [[bison: warnings being treated as errors]]) - # AT_BISON_CHECK_NO_XML(BISON_ARGS, [OTHER_AT_CHECK_ARGS]) - # -------------------------------------------------------- - # Same as AT_BISON_CHECK except don't perform XML/XSLT checks. This is useful - # when a tortured grammar's XML is known to be too large for xsltproc to - # handle. - m4_define([AT_BISON_CHECK_NO_XML], - [AT_CHECK(m4_if(m4_quote($2), [0], [], m4_quote($2), [], [], - [AT_QUELL_VALGRIND ])[[bison ]]$@) - m4_if(m4_bregexp([$4], [: warning: ]), [-1], [], - m4_quote(m4_if(m4_quote($2), [], [0], [$2])), [0], [[ - # Defining POSIXLY_CORRECT causes bison to complain if options + + # AT_BISON_CHECK_(BISON_ARGS, [OTHER_AT_CHECK_ARGS]) + # -------------------------------------------------- + # Low-level macro to run bison once. + m4_define([AT_BISON_CHECK_], + [AT_CHECK(AT_QUELL_VALGRIND[[ bison ]]$@)]) + + + # AT_BISON_CHECK_WARNINGS(BISON_ARGS, [OTHER_AT_CHECK_ARGS]) + # ---------------------------------------------------------- + # Check that warnings (if some are expected) are correctly + # turned into errors with -Werror, etc. + m4_define([AT_BISON_CHECK_WARNINGS], + [m4_if(m4_bregexp([$4], [: warning: ]), [-1], [], + [m4_null_if([$2], [AT_BISON_CHECK_WARNINGS_($@)])])]) + + m4_define([AT_BISON_CHECK_WARNINGS_], + [[# Defining POSIXLY_CORRECT causes bison to complain if options -# are added after the grammar file name, so skip these checks -# in that case. -if test -z "${POSIXLY_CORRECT+set}"; then - ]AT_SAVE_SPECIAL_FILES[ + # are added after the grammar file name, so skip these checks + # in that case. + if test -z "${POSIXLY_CORRECT+set}"; then + ]AT_SAVE_SPECIAL_FILES[ - # To avoid expanding it repeatedly, store specified stdout. - ]AT_DATA([expout], [$3])[ + # To avoid expanding it repeatedly, store specified stdout. + ]AT_DATA([expout], [$3])[ - # Run with -Werror. + # Run with -Werror. - ]AT_CHECK(AT_QUELL_VALGRIND[[ bison ]$1[ -Werror]], - [[1]], [expout], [stderr])[ + ]AT_BISON_CHECK_([$1[ -Werror]], [[1]], [expout], [stderr])[ - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - ]AT_DATA([[at-bison-check-warnings]], [$4])[ - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo ']AT_BISON_WERROR_MSG[' >> experr - - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - ]AT_CHECK([[sed 's,.*/\(]AT_BISON_WERROR_MSG[\)$,\1,' \ - stderr 1>&2]], [[0]], [[]], [experr])[ - - # Now check --warnings=error. - cp stderr experr + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + ]AT_DATA([[at-bison-check-warnings]], [$4])[ + at_bison_check_first=`sed -n \ + '/: warning: /{=;q;}' at-bison-check-warnings` + : ${at_bison_check_first:=1} + at_bison_check_first_tmp=`sed -n \ + '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` + : ${at_bison_check_first_tmp:=1} + if test $at_bison_check_first_tmp -lt $at_bison_check_first; then + at_bison_check_first=$at_bison_check_first_tmp + fi + if test $at_bison_check_first -gt 1; then + sed -n "1,`expr $at_bison_check_first - 1`"p \ + at-bison-check-warnings > experr + fi + echo ']AT_BISON_WERROR_MSG[' >> experr + + # Finish building expected stderr and check. Unlike warnings, + # complaints cause bison to exit early. Thus, with -Werror, bison + # does not necessarily report all warnings that it does without + # -Werror, but it at least reports one. + at_bison_check_last=`sed -n '$=' stderr` + : ${at_bison_check_last:=1} + at_bison_check_last=`expr $at_bison_check_last - 1` + sed -n "$at_bison_check_first,$at_bison_check_last"p \ + at-bison-check-warnings >> experr + ]AT_CHECK([[sed 's,.*/\(]AT_BISON_WERROR_MSG[\)$,\1,' \ + stderr 1>&2]], [[0]], [[]], [experr])[ + + # Now check --warnings=error. + cp stderr experr - ]AT_CHECK(AT_QUELL_VALGRIND[[ bison ]$1[ --warnings=error]], - [[1]], [expout], [experr])[ + ]AT_BISON_CHECK_([$1[ --warnings=error]], [[1]], [expout], [experr])[ - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. - ]AT_CHECK(AT_QUELL_VALGRIND[[ bison ]$1[ -Wnone -Werror]], - [[0]], [expout])[ - ]AT_CHECK(AT_QUELL_VALGRIND[[ bison ]$1[ --warnings=none \ - -Werror]], [[0]], [expout])[ + ]AT_BISON_CHECK_([$1[ -Wnone -Werror]], [[0]], [expout])[ + ]AT_BISON_CHECK_([$1[ --warnings=none -Werror]], [[0]], [expout])[ - ]AT_RESTORE_SPECIAL_FILES[ + ]AT_RESTORE_SPECIAL_FILES[ - fi - ]]) + fi]dnl ]) + # AT_BISON_CHECK_NO_XML(BISON_ARGS, [OTHER_AT_CHECK_ARGS]) + # -------------------------------------------------------- + # Same as AT_BISON_CHECK except don't perform XML/XSLT checks. This is useful + # when a tortured grammar's XML is known to be too large for xsltproc to + # handle. + m4_define([AT_BISON_CHECK_NO_XML], + [AT_CHECK(m4_null_if([$2], [], [AT_QUELL_VALGRIND ])[[bison ]]$@) + AT_BISON_CHECK_WARNINGS($@)]) + # AT_BISON_CHECK_XML(BISON_ARGS, [OTHER_AT_CHECK_ARGS]) # ----------------------------------------------------- # Run AT_BISON_CHECK's XML/XSLT checks if $BISON_TEST_XML=1 and $XSLTPROC is @@@ -521,11 -542,11 +545,11 @@@ m4_define([AT_BISON_CHECK_XML] [--xml=[^][ ]*], [])])dnl # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. - AT_CHECK([[bison --report=all --report-file=xml-tests/test.output \ + AT_BISON_CHECK_([[--report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot ]]AT_BISON_ARGS, - [[0]], [ignore], [ignore]) + --graph=xml-tests/test.dot ]]AT_BISON_ARGS, + [[0]], [ignore], [ignore]) - AT_CHECK([[bison --xml=xml-tests/test.xml ]]AT_BISON_ARGS, + AT_BISON_CHECK_([[--xml=xml-tests/test.xml ]]AT_BISON_ARGS, - [[0]], [ignore], [ignore]) + [[0]], [ignore], [ignore]) m4_popdef([AT_BISON_ARGS])dnl [cp xml-tests/test.output expout] AT_CHECK([[$XSLTPROC \ diff --cc tests/local.mk index 4f2ee52d,00000000..dc5b6c48 mode 100644,000000..100644 --- a/tests/local.mk +++ b/tests/local.mk @@@ -1,125 -1,0 +1,125 @@@ +## Makefile for Bison testsuite. + +# Copyright (C) 2000-2012 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# 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, see . + +EXTRA_DIST += $(TESTSUITE_AT) tests/testsuite + +DISTCLEANFILES += tests/atconfig $(check_SCRIPTS) +MAINTAINERCLEANFILES += $(TESTSUITE) + +## ------------ ## +## package.m4. ## +## ------------ ## + +$(top_srcdir)/tests/package.m4: $(top_srcdir)/configure + $(AM_V_GEN)rm -f $@ $@.tmp + $(AM_V_at){ \ + echo '# Signature of the current package.'; \ + echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \ + echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])'; \ + echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \ + echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \ + echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \ + } >$@.tmp + $(AM_V_at)mv $@.tmp $@ + +## ------------------------- ## +## Generate the test suite. ## +## ------------------------- ## + +TESTSUITE_AT = \ + tests/testsuite.at \ + \ + tests/actions.at \ + tests/c++.at \ + tests/calc.at \ + tests/conflicts.at \ + tests/cxx-type.at \ + tests/existing.at \ + tests/glr-regression.at \ + tests/headers.at \ + tests/input.at \ + tests/java.at \ + tests/local.at \ + tests/named-refs.at \ + tests/output.at \ + tests/package.m4 \ + tests/push.at \ + tests/reduce.at \ + tests/regression.at \ + tests/sets.at \ + tests/skeletons.at \ + tests/synclines.at \ + tests/torture.at + +TESTSUITE = $(top_srcdir)/tests/testsuite + +AUTOTEST = $(AUTOM4TE) --language=autotest +AUTOTESTFLAGS = -I $(top_srcdir)/tests +$(TESTSUITE): $(TESTSUITE_AT) + $(AM_V_GEN) \ + $(AUTOTEST) $(AUTOTESTFLAGS) $(srcdir)/tests/testsuite.at -o $@.tmp + $(AM_V_at)mv $@.tmp $@ + + +## -------------------- ## +## Run the test suite. ## +## -------------------- ## + +# Move into tests/ so that testsuite.dir etc. be created there. +RUN_TESTSUITE = $(TESTSUITE) -C tests $(TESTSUITEFLAGS) +check_SCRIPTS = $(BISON) tests/atconfig tests/atlocal +RUN_TESTSUITE_deps = $(TESTSUITE) $(check_SCRIPTS) + +clean-local: clean-local-tests +clean-local-tests: + test ! -f $(TESTSUITE) || $(TESTSUITE) -C tests --clean + +check-local: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) + +# Run the test suite on the *installed* tree. +installcheck-local: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) AUTOTEST_PATH='$(bindir)' + +# Be real mean with it. +.PHONY: maintainer-check-g++ +maintainer-check-g++: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) --compile-c-with-cxx + +.PHONY: maintainer-check-posix +maintainer-check-posix: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) POSIXLY_CORRECT=1 _POSIX2_VERSION=200112 + +.PHONY: maintainer-check-valgrind +maintainer-check-valgrind: $(RUN_TESTSUITE_deps) + test -z '$(VALGRIND)' || \ + $(RUN_TESTSUITE) \ - PREBISON='$(VALGRIND) -q' PREPARSER='$(VALGRIND) -q' \ ++ PREBISON='$(VALGRIND_PREBISON)' PREPARSER='$(VALGRIND) -q' \ + VALGRIND_OPTS='--leak-check=full --show-reachable=yes' + +.PHONY: maintainer-check +maintainer-check: maintainer-check-posix maintainer-check-valgrind maintainer-check-g++ + +.PHONY: maintainer-push-check +maintainer-push-check: + $(MAKE) $(AM_MAKEFLAGS) maintainer-check \ + TESTSUITEFLAGS='BISON_USE_PUSH_FOR_PULL=1 $(TESTSUITEFLAGS)' + +.PHONY: maintainer-xml-check +maintainer-xml-check: + $(MAKE) $(AM_MAKEFLAGS) maintainer-check \ + TESTSUITEFLAGS='BISON_TEST_XML=1 $(TESTSUITEFLAGS)'