Merge remote-tracking branch 'origin/maint'

* origin/maint:
  news: prepare for forthcoming release
  doc: explain how mid-rule actions are translated
  error: use better locations for unused midrule values
  doc: various minor improvements and fixes
  tests: ignore more useless compiler warnings
  tests: be robust to C being compiled with a C++11 compiler
  build: beware of Clang++ not supporting POSIXLY_CORRECT
  maint: post-release administrivia
  version 2.6.90
  build: fix syntax-check error.
  cpp: simplify the Flex version checking macro
  news: improve the carets example and fix a typo
  cpp: improve the Flex version checking macro
  carets: improve the code
  maint: update news
  build: keep -Wmissing-declarations and -Wmissing-prototypes for modern GCCs
  build: drop -Wcast-qual
  gnulib: update

Conflicts:
	NEWS
	doc/Makefile.am
	doc/bison.texi
	gnulib
	src/reader.c
	tests/actions.at
	tests/atlocal.in
	tests/input.at
This commit is contained in:
Theophile Ranquet
2012-12-10 17:01:55 +01:00
18 changed files with 611 additions and 278 deletions

View File

@@ -1326,7 +1326,7 @@ AT_BISON_CHECK([-o input.c input.y], 0,,
[[input.y:24.70-72: warning: useless %destructor for type <*> [-Wother]
input.y:24.70-72: warning: useless %printer for type <*> [-Wother]
input.y:33.3-23: warning: unset value: $$ [-Wother]
input.y:30.3-35.37: warning: unused value: $3 [-Wother]
input.y:32.3-23: warning: unused value: $3 [-Wother]
]])
AT_BISON_CHECK([-fcaret -o input.c input.y], 0,,
@@ -1339,9 +1339,9 @@ input.y:24.70-72: warning: useless %printer for type <*> [-Wother]
input.y:33.3-23: warning: unset value: $$ [-Wother]
{ @$ = 4; } // Only used.
^^^^^^^^^^^^^^^^^^^^^
input.y:30.3-35.37: warning: unused value: $3 [-Wother]
{ @$ = 1; } // Not set or used.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:32.3-23: warning: unused value: $3 [-Wother]
{ USE ($$); @$ = 3; } // Only set.
^^^^^^^^^^^^^^^^^^^^^
]])
AT_COMPILE([input])

View File

@@ -19,6 +19,15 @@
# We need `config.h'.
CPPFLAGS="-I$abs_top_builddir/lib @CPPFLAGS@"
# Don't just check if $POSIXLY_CORRECT is set, as Bash, when launched
# as /bin/sh, sets the shell variable POSIXLY_CORRECT to y, but not
# the environment variable.
if env | grep '^POSIXLY_CORRECT=' >/dev/null; then
POSIXLY_CORRECT_IS_EXPORTED=true
else
POSIXLY_CORRECT_IS_EXPORTED=false
fi
## ------------------- ##
## C/C++ Compilation. ##
## ------------------- ##
@@ -44,12 +53,24 @@ NO_STRICT_ALIAS_CXXFLAGS='@NO_STRICT_ALIAS_CXXFLAGS@'
# If 'exit 77'; skip all C++ tests; otherwise ':'.
BISON_CXX_WORKS='@BISON_CXX_WORKS@'
# Whether the compiler supports POSIXLY_CORRECT defined.
: ${C_COMPILER_POSIXLY_CORRECT='@C_COMPILER_POSIXLY_CORRECT@'}
: ${CXX_COMPILER_POSIXLY_CORRECT='@CXX_COMPILER_POSIXLY_CORRECT@'}
if $POSIXLY_CORRECT_IS_EXPORTED; then
$C_COMPILER_POSIXLY_CORRECT ||
BISON_C_WORKS="as_fn_error 77 POSIXLY_CORRECT"
$CXX_COMPILER_POSIXLY_CORRECT ||
BISON_CXX_WORKS="as_fn_error 77 POSIXLY_CORRECT"
fi
# Handle --compile-c-with-cxx here, once CXX and CXXFLAGS are known.
if "$at_arg_compile_c_with_cxx"; then
CC_IS_CXX=1
CC=$CXX
NO_WERROR_CFLAGS=$NO_WERROR_CXXFLAGS
CFLAGS=$CXXFLAGS
BISON_C_WORKS=$BISON_CXX_WORKS
else
CC_IS_CXX=0
fi

View File

@@ -18,9 +18,9 @@
AT_BANNER([[GLR Regression Tests]])
## --------------------------- ##
## Badly Collapsed GLR States. ##
## --------------------------- ##
## ---------------------------- ##
## Badly Collapsed GLR States. ##
## ---------------------------- ##
AT_SETUP([Badly Collapsed GLR States])
@@ -67,7 +67,7 @@ static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1)
return 0;
}
const char *input = NULL;
const char *input = YY_NULL;
int
main (int argc, const char* argv[])
@@ -105,9 +105,9 @@ E -> E 'P' E
AT_CLEANUP
## ------------------------------------------------------------ ##
## Improper handling of embedded actions and $-N in GLR parsers ##
## ------------------------------------------------------------ ##
## -------------------------------------------------------------- ##
## Improper handling of embedded actions and $-N in GLR parsers. ##
## -------------------------------------------------------------- ##
AT_SETUP([Improper handling of embedded actions and dollar(-N) in GLR parsers])
@@ -236,9 +236,9 @@ AT_PARSER_CHECK([[./glr-regr2a input3.txt]], 0,
AT_CLEANUP
## ------------------------------------------------------------ ##
## Improper merging of GLR delayed action sets ##
## ------------------------------------------------------------ ##
## --------------------------------------------- ##
## Improper merging of GLR delayed action sets. ##
## --------------------------------------------- ##
AT_SETUP([Improper merging of GLR delayed action sets])
@@ -355,10 +355,10 @@ AT_PARSER_CHECK([[./glr-regr3 input.txt]],
AT_CLEANUP
## ------------------------------------------------------------------------- ##
## Duplicate representation of merged trees. See ##
## <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>. ##
## ------------------------------------------------------------------------- ##
## ---------------------------------------------------------------------- ##
## Duplicate representation of merged trees. See ##
## <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>. ##
## ---------------------------------------------------------------------- ##
AT_SETUP([Duplicate representation of merged trees])
@@ -446,10 +446,10 @@ AT_PARSER_CHECK([[./glr-regr4]], 0,
AT_CLEANUP
## -------------------------------------------------------------------------- ##
## User destructor for unresolved GLR semantic value. See ##
## <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html>. ##
## -------------------------------------------------------------------------- ##
## ------------------------------------------------------------------------- ##
## User destructor for unresolved GLR semantic value. See ##
## <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html>. ##
## ------------------------------------------------------------------------- ##
AT_SETUP([User destructor for unresolved GLR semantic value])
@@ -506,10 +506,10 @@ AT_PARSER_CHECK([[./glr-regr5]], 0, [],
AT_CLEANUP
## -------------------------------------------------------------------------- ##
## User destructor after an error during a split parse. See ##
## <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html>. ##
## -------------------------------------------------------------------------- ##
## ------------------------------------------------------------------------- ##
## User destructor after an error during a split parse. See ##
## <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html>. ##
## ------------------------------------------------------------------------- ##
AT_SETUP([User destructor after an error during a split parse])
@@ -561,7 +561,7 @@ AT_CLEANUP
## ------------------------------------------------------------------------- ##
## Duplicated user destructor for lookahead. See ##
## Duplicated user destructor for lookahead. See ##
## <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00035.html>. ##
## ------------------------------------------------------------------------- ##
@@ -744,7 +744,7 @@ AT_CLEANUP
## ------------------------------------------------------------------------- ##
## No users destructors if stack 0 deleted. See ##
## No users destructors if stack 0 deleted. See ##
## <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00109.html>. ##
## ------------------------------------------------------------------------- ##
@@ -821,9 +821,9 @@ AT_PARSER_CHECK([[./glr-regr9]], 0, [],
AT_CLEANUP
## ------------------------------------------------------------------------- ##
## Corrupted semantic options if user action cuts parse. ##
## ------------------------------------------------------------------------- ##
## ------------------------------------------------------ ##
## Corrupted semantic options if user action cuts parse. ##
## ------------------------------------------------------ ##
AT_SETUP([Corrupted semantic options if user action cuts parse])
@@ -875,9 +875,9 @@ AT_PARSER_CHECK([[./glr-regr10]], 0, [], [])
AT_CLEANUP
## ------------------------------------------------------------------------- ##
## Undesirable destructors if user action cuts parse. ##
## ------------------------------------------------------------------------- ##
## --------------------------------------------------- ##
## Undesirable destructors if user action cuts parse. ##
## --------------------------------------------------- ##
AT_SETUP([Undesirable destructors if user action cuts parse])
@@ -933,9 +933,9 @@ AT_PARSER_CHECK([[./glr-regr11]], 0, [], [])
AT_CLEANUP
## ------------------------------------------------------------------------- ##
## Leaked semantic values if user action cuts parse. ##
## ------------------------------------------------------------------------- ##
## -------------------------------------------------- ##
## Leaked semantic values if user action cuts parse. ##
## -------------------------------------------------- ##
AT_SETUP([Leaked semantic values if user action cuts parse])
@@ -1181,9 +1181,9 @@ start <- defstate_init defstate_shift 'b':
AT_CLEANUP
## ------------------------------------------------------------------------- ##
## Incorrect lookahead during nondeterministic GLR. ##
## ------------------------------------------------------------------------- ##
## ------------------------------------------------- ##
## Incorrect lookahead during nondeterministic GLR. ##
## ------------------------------------------------- ##
AT_SETUP([Incorrect lookahead during nondeterministic GLR])
@@ -1398,9 +1398,9 @@ start <- merge 'c' stack_explosion:
AT_CLEANUP
## ------------------------------------------------------------------------- ##
## Leaked semantic values when reporting ambiguity. ##
## ------------------------------------------------------------------------- ##
## ------------------------------------------------- ##
## Leaked semantic values when reporting ambiguity. ##
## ------------------------------------------------- ##
AT_SETUP([Leaked semantic values when reporting ambiguity])
@@ -1480,9 +1480,9 @@ AT_PARSER_CHECK([[./glr-regr15]], 0, [],
AT_CLEANUP
## ------------------------------------------------------------------------- ##
## Leaked lookahead after nondeterministic parse syntax error. ##
## ------------------------------------------------------------------------- ##
## ------------------------------------------------------------ ##
## Leaked lookahead after nondeterministic parse syntax error. ##
## ------------------------------------------------------------ ##
AT_SETUP([Leaked lookahead after nondeterministic parse syntax error])
@@ -1540,9 +1540,9 @@ AT_PARSER_CHECK([[./glr-regr16]], 0, [],
AT_CLEANUP
## ------------------------------------------------------------------------- ##
## Uninitialized location when reporting ambiguity. ##
## ------------------------------------------------------------------------- ##
## ------------------------------------------------- ##
## Uninitialized location when reporting ambiguity. ##
## ------------------------------------------------- ##
AT_SETUP([Uninitialized location when reporting ambiguity])
@@ -1618,9 +1618,9 @@ AT_PARSER_CHECK([[./glr-regr17]], 0, [],
AT_CLEANUP
## -------------------------------------------------------------##
## Missed %merge type warnings when LHS type is declared later. ##
## -------------------------------------------------------------##
## ------------------------------------------------------------- ##
## Missed %merge type warnings when LHS type is declared later. ##
## ------------------------------------------------------------- ##
AT_SETUP([Missed %merge type warnings when LHS type is declared later])

View File

@@ -169,42 +169,109 @@ l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<
_AT_UNUSED_VALUES_DECLARATIONS])
)
AT_BISON_CHECK(m4_ifval($2, [ --warnings=midrule-values ])[ input.y], [0], [],
[[input.y:11.10-32: warning: unset value: $]$[ [-Wother]
input.y:11.10-32: warning: unused value: $]1[ [-Wother]
input.y:11.10-32: warning: unused value: $]3[ [-Wother]
input.y:11.10-32: warning: unused value: $]5[ [-Wother]
AT_BISON_CHECK(m4_ifval($2, [--warnings=midrule-values ])[-fcaret input.y],
[0], [],
[[input.y:11.10-32: warning: unset value: $][$ [-Wother]
a: INT | INT { } INT { } INT { };
^^^^^^^^^^^^^^^^^^^^^^^
input.y:11.10-12: warning: unused value: $][1 [-Wother]
a: INT | INT { } INT { } INT { };
^^^
input.y:11.18-20: warning: unused value: $][3 [-Wother]
a: INT | INT { } INT { } INT { };
^^^
input.y:11.26-28: warning: unused value: $][5 [-Wother]
a: INT | INT { } INT { } INT { };
^^^
input.y:12.9: warning: empty rule for typed nonterminal, and no action [-Wother]
]]m4_ifval($2, [[[input.y:13.14-20: warning: unset value: $$ [-Wmidrule-values]
input.y:13.26-41: warning: unset value: $$ [-Wmidrule-values]
]]])[[input.y:13.10-62: warning: unset value: $]$[ [-Wother]
input.y:13.10-62: warning: unused value: $]3[ [-Wother]
input.y:13.10-62: warning: unused value: $]5[ [-Wother]
]]m4_ifval($2, [[[input.y:14.14-16: warning: unset value: $$ [-Wmidrule-values]
]]])[[input.y:14.10-49: warning: unset value: $]$[ [-Wother]
input.y:14.10-49: warning: unused value: $]3[ [-Wother]
input.y:14.10-49: warning: unused value: $]5[ [-Wother]
input.y:15.10-37: warning: unset value: $]$[ [-Wother]
input.y:15.10-37: warning: unused value: $]3[ [-Wother]
input.y:15.10-37: warning: unused value: $]5[ [-Wother]
input.y:17.10-58: warning: unset value: $]$[ [-Wother]
input.y:17.10-58: warning: unused value: $]1[ [-Wother]
]]m4_ifval($2, [[[input.y:17.10-58: warning: unused value: $]2[ [-Wmidrule-values]
]]])[[input.y:17.10-58: warning: unused value: $]3[ [-Wother]
]]m4_ifval($2, [[[input.y:17.10-58: warning: unused value: $]4[ [-Wmidrule-values]
]]])[[input.y:17.10-58: warning: unused value: $]5[ [-Wother]
input.y:18.10-72: warning: unset value: $]$[ [-Wother]
input.y:18.10-72: warning: unused value: $]1[ [-Wother]
input.y:18.10-72: warning: unused value: $]3[ [-Wother]
]]m4_ifval($2, [[[input.y:18.10-72: warning: unused value: $]4[ [-Wmidrule-values]
]]])[[input.y:18.10-72: warning: unused value: $]5[ [-Wother]
]]m4_ifval($2, [[[input.y:20.10-55: warning: unused value: $]3[ [-Wmidrule-values]
]]])[[input.y:21.10-68: warning: unset value: $]$[ [-Wother]
input.y:21.10-68: warning: unused value: $]1[ [-Wother]
input.y:21.10-68: warning: unused value: $]2[ [-Wother]
]]m4_ifval($2, [[[input.y:21.10-68: warning: unused value: $]4[ [-Wmidrule-values]
]]]))])
b: INT | /* empty */;
^
]]m4_ifval($2, [[[input.y:13.14-20: warning: unset value: $][$ [-Wmidrule-values]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
^^^^^^^
input.y:13.26-41: warning: unset value: $][$ [-Wmidrule-values]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
^^^^^^^^^^^^^^^^
]]])[[input.y:13.10-62: warning: unset value: $][$ [-Wother]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:13.22-24: warning: unused value: $][3 [-Wother]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
^^^
input.y:13.43-45: warning: unused value: $][5 [-Wother]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
^^^
]]m4_ifval($2, [[[input.y:14.14-16: warning: unset value: $][$ [-Wmidrule-values]
d: INT | INT { } INT { $][1; } INT { $<integer>2; };
^^^
]]])[[input.y:14.10-49: warning: unset value: $][$ [-Wother]
d: INT | INT { } INT { $][1; } INT { $<integer>2; };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:14.18-20: warning: unused value: $][3 [-Wother]
d: INT | INT { } INT { $][1; } INT { $<integer>2; };
^^^
input.y:14.30-32: warning: unused value: $][5 [-Wother]
d: INT | INT { } INT { $][1; } INT { $<integer>2; };
^^^
input.y:15.10-37: warning: unset value: $][$ [-Wother]
e: INT | INT { } INT { } INT { $][1; };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:15.18-20: warning: unused value: $][3 [-Wother]
e: INT | INT { } INT { } INT { $][1; };
^^^
input.y:15.27-29: warning: unused value: $][5 [-Wother]
e: INT | INT { } INT { } INT { $][1; };
^^^
input.y:17.10-58: warning: unset value: $][$ [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:17.10-12: warning: unused value: $][1 [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^
]]m4_ifval($2, [[[input.y:17.14-29: warning: unused value: $][2 [-Wmidrule-values]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^^^^^^^^^^^^^^
]]])[[input.y:17.31-33: warning: unused value: $][3 [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^
]]m4_ifval($2, [[[input.y:17.35-50: warning: unused value: $][4 [-Wmidrule-values]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^^^^^^^^^^^^^^
]]])[[input.y:17.52-54: warning: unused value: $][5 [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^
input.y:18.10-72: warning: unset value: $][$ [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.10-12: warning: unused value: $][1 [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
^^^
input.y:18.31-33: warning: unused value: $][3 [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
^^^
]]m4_ifval($2, [[[input.y:18.35-64: warning: unused value: $][4 [-Wmidrule-values]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
]]])[[input.y:18.66-68: warning: unused value: $][5 [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
^^^
]]m4_ifval($2, [[[input.y:20.18-37: warning: unused value: $][3 [-Wmidrule-values]
j: INT | INT INT { $<integer>$ = 1; } { $][$ = $][1 + $][2; };
^^^^^^^^^^^^^^^^^^^^
]]])[[input.y:21.10-68: warning: unset value: $][$ [-Wother]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:21.10-12: warning: unused value: $][1 [-Wother]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
^^^
input.y:21.14-16: warning: unused value: $][2 [-Wother]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
^^^
]]m4_ifval($2, [[[input.y:21.35-64: warning: unused value: $][4 [-Wmidrule-values]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
]]]))
])
## --------------- ##
## Unused values. ##
@@ -465,7 +532,7 @@ tagged: { } ;
AT_BISON_CHECK([input.y], [0], [],
[[input.y:6.8-45: warning: unset value: $$ [-Wother]
input.y:6.8-45: warning: unused value: $2 [-Wother]
input.y:6.12-14: warning: unused value: $2 [-Wother]
input.y:7.6-8: warning: unset value: $$ [-Wother]
]])
@@ -481,7 +548,7 @@ tagged: { } ;
]])
AT_BISON_CHECK([input.y], [0], [],
[[input.y:6.8-45: warning: unused value: $4 [-Wother]
[[input.y:6.23-28: warning: unused value: $4 [-Wother]
input.y:8.9-11: warning: unset value: $$ [-Wother]
]])
@@ -506,7 +573,7 @@ end: { } ;
AT_BISON_CHECK([input.y], [0], [],
[[input.y:6.8-22: warning: unset value: $$ [-Wother]
input.y:6.8-22: warning: unused value: $2 [-Wother]
input.y:6.12-14: warning: unused value: $2 [-Wother]
input.y:7.6-8: warning: unset value: $$ [-Wother]
]])

View File

@@ -581,9 +581,7 @@ m4_define([AT_QUELL_VALGRIND],
# otherwise pass "-c"; this is a hack. The default SOURCES is OUTPUT
# with trailing .o removed, and ".c" appended.
m4_define([AT_COMPILE],
[AT_CHECK([case $POSIXLY_CORRECT_IS_EXPORTED:$C_COMPILER_POSIXLY_CORRECT in
true:false) echo 'cannot compile properly with POSIXLY_CORRECT' && exit 77;;
esac])
[AT_CHECK([$BISON_C_WORKS], 0, ignore, ignore)
AT_CHECK(m4_join([ ],
[$CC $CFLAGS $CPPFLAGS],
[m4_bmatch([$1], [[.]], [-c], [$LDFLAGS])],

View File

@@ -54,7 +54,7 @@ m4_define([AT_SYNCLINES_COMPILE],
# #error "1"
# ^
#
# And possibly distcc adds its bits.
# Possibly distcc adds its bits.
#
# distcc[33187] ERROR: compile (null) on localhost failed
# syncline.c:1:2: error: #error "1"
@@ -71,11 +71,18 @@ m4_define([AT_SYNCLINES_COMPILE],
# #error "1"
# ^
# 1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
AT_CHECK([[$PERL -p -0777 - stderr <<\EOF
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error.