From 83ebc8bdb66a45b0a82d1b7ae7024cf69c53df4c Mon Sep 17 00:00:00 2001 From: Kiyoshi Kanazawa Date: Sun, 27 Jan 2019 06:58:17 +0100 Subject: [PATCH 1/5] tests: don't depend on the user's definition of SHELL http://lists.gnu.org/archive/html/bug-bison/2019-01/msg00031.html * examples/test (SHELL): Set it to /bin/sh. --- examples/test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/test b/examples/test index 5e643c1f..d987d094 100755 --- a/examples/test +++ b/examples/test @@ -15,6 +15,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +SHELL=/bin/sh +export SHELL + me=$(basename "$1" .test) medir=$(dirname "$1" | sed -e 's,.*examples/,,') From 59a108c0a662f5598e1c5fc574f7d37711a6d103 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 27 Jan 2019 07:17:54 +0100 Subject: [PATCH 2/5] style: formatting changes in NEWS and complain.c --- NEWS | 8 ++++---- src/complain.c | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 9fc2e3f6..6172bad6 100644 --- a/NEWS +++ b/NEWS @@ -5,11 +5,11 @@ GNU Bison NEWS * Noteworthy changes in release 3.3 (2019-01-26) [stable] -A new mailing list was created, Bison Announce. It is low traffic, and is -only about announcing new releases and important messages (e.g., polls about -major decisions to make). + A new mailing list was created, Bison Announce. It is low traffic, and is + only about announcing new releases and important messages (e.g., polls + about major decisions to make). -https://lists.gnu.org/mailman/listinfo/bison-announce + https://lists.gnu.org/mailman/listinfo/bison-announce ** Backward incompatible changes diff --git a/src/complain.c b/src/complain.c index a4ab0a1f..50f65af5 100644 --- a/src/complain.c +++ b/src/complain.c @@ -421,8 +421,10 @@ duplicate_rule_directive (char const *directive, location first, location second) { unsigned i = 0; - complain_indent (&second, complaint, &i, _("only one %s allowed per rule"), directive); + complain_indent (&second, complaint, &i, + _("only one %s allowed per rule"), directive); i += SUB_INDENT; - complain_indent (&first, complaint, &i, _("previous declaration")); + complain_indent (&first, complaint, &i, + _("previous declaration")); fixits_register (&second, ""); } From 8b0b2955691f511eb91cc6eb0fec75601aea80ac Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 27 Jan 2019 06:38:27 +0100 Subject: [PATCH 3/5] yacc: issue warnings, not errors, for Bison extensions Reported by Kiyoshi Kanazawa. http://lists.gnu.org/archive/html/bug-bison/2019-01/msg00029.html * src/getargs.c (getargs): Let --yacc imply -Wyacc, not -Werror=yacc. * tests/input.at: Adjust. * doc/bison.tex (Bison Options): Document. --- NEWS | 4 ++++ doc/bison.texi | 28 ++++++++++++++-------------- src/getargs.c | 2 +- tests/input.at | 18 +++++++++--------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/NEWS b/NEWS index 6172bad6..ae5b923a 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ GNU Bison NEWS * Noteworthy changes in release ?.? (????-??-??) [?] +** Changes + + The option -y/--yacc used to imply -Werror=yacc, which turns uses of Bison + extensions into errors. It now makes them simple warnings (-Wyacc). * Noteworthy changes in release 3.3 (2019-01-26) [stable] diff --git a/doc/bison.texi b/doc/bison.texi index 884a7bd8..279b73d2 100644 --- a/doc/bison.texi +++ b/doc/bison.texi @@ -10308,26 +10308,26 @@ See the documentation of @option{--feature=fixit} below for more details. @item -y @itemx --yacc -Act more like the traditional Yacc command. This can cause different -diagnostics to be generated, and may change behavior in other minor -ways. Most importantly, imitate Yacc's output file name conventions, -so that the parser implementation file is called @file{y.tab.c}, and -the other outputs are called @file{y.output} and @file{y.tab.h}. -Also, if generating a deterministic parser in C, generate -@code{#define} statements in addition to an @code{enum} to associate -token numbers with token names. Thus, the following shell script can -substitute for Yacc, and the Bison distribution contains such a script -for compatibility with POSIX: +Act more like the traditional @command{yacc} command. This can cause +different diagnostics to be generated (it implies @option{-Wyacc}), and may +change behavior in other minor ways. Most importantly, imitate Yacc's +output file name conventions, so that the parser implementation file is +called @file{y.tab.c}, and the other outputs are called @file{y.output} and +@file{y.tab.h}. Also, if generating a deterministic parser in C, generate +@code{#define} statements in addition to an @code{enum} to associate token +numbers with token names. Thus, the following shell script can substitute +for Yacc, and the Bison distribution contains such a script for +compatibility with POSIX: @example #! /bin/sh bison -y "$@@" @end example -The @option{-y}/@option{--yacc} option is intended for use with -traditional Yacc grammars. If your grammar uses a Bison extension -like @samp{%glr-parser}, Bison might not be Yacc-compatible even if -this option is specified. +The @option{-y}/@option{--yacc} option is intended for use with traditional +Yacc grammars. If your grammar uses Bison extensions like +@samp{%glr-parser}, Bison might not be Yacc-compatible even if this option +is specified. @item -W [@var{category}] @itemx --warnings[=@var{category}] diff --git a/src/getargs.c b/src/getargs.c index 95572681..417e163c 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -708,7 +708,7 @@ getargs (int argc, char *argv[]) break; case 'y': - warning_argmatch ("error=yacc", 0, 6); + warning_argmatch ("yacc", 0, 0); yacc_loc = command_line_location (); break; diff --git a/tests/input.at b/tests/input.at index 8853af51..7494e46a 100644 --- a/tests/input.at +++ b/tests/input.at @@ -1402,15 +1402,15 @@ without_period: "WITHOUT.PERIOD"; AT_BISON_OPTION_POPDEFS # POSIX Yacc accept periods, but not dashes. -AT_BISON_CHECK([--yacc input.y], [1], [], -[[input.y:1.1-5: error: POSIX Yacc does not support %code [-Werror=yacc] -input.y:9.8-16: error: POSIX Yacc forbids dashes in symbol names: WITH-DASH [-Werror=yacc] -input.y:10.21-34: error: POSIX Yacc does not support string literals [-Werror=yacc] -input.y:12.23-38: error: POSIX Yacc does not support string literals [-Werror=yacc] -input.y:13.1-5: error: POSIX Yacc does not support %code [-Werror=yacc] -input.y:20.8-16: error: POSIX Yacc forbids dashes in symbol names: with-dash [-Werror=yacc] -input.y:22.15-28: error: POSIX Yacc does not support string literals [-Werror=yacc] -input.y:24.17-32: error: POSIX Yacc does not support string literals [-Werror=yacc] +AT_BISON_CHECK([--yacc input.y], [], [], +[[input.y:1.1-5: warning: POSIX Yacc does not support %code [-Wyacc] +input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH [-Wyacc] +input.y:10.21-34: warning: POSIX Yacc does not support string literals [-Wyacc] +input.y:12.23-38: warning: POSIX Yacc does not support string literals [-Wyacc] +input.y:13.1-5: warning: POSIX Yacc does not support %code [-Wyacc] +input.y:20.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash [-Wyacc] +input.y:22.15-28: warning: POSIX Yacc does not support string literals [-Wyacc] +input.y:24.17-32: warning: POSIX Yacc does not support string literals [-Wyacc] ]]) # Dashes are fine for GNU Bison. From ed02d34fbcc9e441e8a2dd8257993d5425795b56 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 27 Jan 2019 16:03:23 +0100 Subject: [PATCH 4/5] version 3.3.1 * NEWS: Record release date. --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ae5b923a..bbd18a96 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ GNU Bison NEWS -* Noteworthy changes in release ?.? (????-??-??) [?] +* Noteworthy changes in release 3.3.1 (2019-01-27) [stable] ** Changes From 7a21067bb92fc1e568ccb3a791924f828d2763cd Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 27 Jan 2019 16:17:28 +0100 Subject: [PATCH 5/5] maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. --- .prev-version | 2 +- NEWS | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.prev-version b/.prev-version index eb39e538..bea438e9 100644 --- a/.prev-version +++ b/.prev-version @@ -1 +1 @@ -3.3 +3.3.1 diff --git a/NEWS b/NEWS index bbd18a96..64aa3b61 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ GNU Bison NEWS +* Noteworthy changes in release ?.? (????-??-??) [?] + + * Noteworthy changes in release 3.3.1 (2019-01-27) [stable] ** Changes