Upgrade parsers to Bison >= 3.0

Bison 3.0 was released in 2013, and the current Debian stable (buster)
has version 3.3.2.

* m4/bison.m4: Remove -Wno-precedence and -Wno-empty-rule, keep
-Wno-deprecated just to protect from future deprecation warnings that
would be interpreted as errors.
* spot/parseaut/parseaut.yy, spot/parsetl/parsetl.yy: Use %empty
rules, prefer %precedence over %nonassoc, update %error-versbose and
%name-prefix to their more modern equivalent.
* spot/misc/trival.hh (maybe): Mark this function as noexcept to
please the compiler while compiling the parsers.
This commit is contained in:
Alexandre Duret-Lutz 2019-08-26 17:07:15 +02:00
parent e52aa8f9eb
commit b9808144b3
4 changed files with 53 additions and 47 deletions

View file

@ -2,12 +2,7 @@ AC_DEFUN([adl_CHECK_BISON],
[AC_ARG_VAR([BISON], [Bison parser generator])
AC_CHECK_PROGS([BISON], [bison])
if test -n "$BISON"; then
# Bison 3.0 has warning about issues that cannot be fixed in a
# compatible way with Bison 2.7. Since we want to be compatible
# with both version AND use -Werror, disable those warnings.
# (Unfortunately -Wno-error=empty-rule,no-error=deprecated does not
# work: https://lists.gnu.org/archive/html/bug-bison/2013-09/index.html)
opt='-Wno-empty-rule -Wno-deprecated -Wno-precedence'
opt='-Wno-deprecated'
if AM_RUN_LOG([$BISON $opt --version]); then
BISON_EXTRA_FLAGS=$opt
fi