mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
glr2.cc: fix warning with GCC 4.7 and 4.8
231. conflicts.at:1096: testing Syntax error in consistent error state: glr2.cc ...
tests/conflicts.at:1096: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
input.cc: In function 'int yyparse(yy::parser&)':
input.cc:3147:41: error: 'yyarg' may be used uninitialized in this function [-Werror=maybe-uninitialized]
return yytnamerr_ (yytname_[yysymbol]);
^
input.cc:2058:34: note: 'yyarg' was declared here
yy::parser::symbol_kind_type yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
^
* data/skeletons/glr2.cc (yyreportSyntaxError): Initialize yyarg.
This commit is contained in:
@@ -1812,8 +1812,9 @@ class state_stack {
|
||||
#define YYFILL(N) yystateStack.yyfill (yyvsp, &yylow, (N), yynormal)
|
||||
|
||||
#define yystackp this
|
||||
class glr_stack {
|
||||
public:
|
||||
class glr_stack
|
||||
{
|
||||
public:
|
||||
|
||||
glr_stack(size_t yysize, ]b4_namespace_ref[::]b4_parser_class[& yyparser_yyarg]m4_ifset([b4_parse_param], [, b4_parse_param_decl])[)
|
||||
: yyerrState(0)
|
||||
@@ -1911,7 +1912,8 @@ class glr_stack {
|
||||
: YYTRANSLATE (yychar);
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Arguments of yyformat. */
|
||||
]b4_namespace_ref::b4_parser_class[::symbol_kind_type yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
]b4_namespace_ref::b4_parser_class[::symbol_kind_type yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]
|
||||
= { ]b4_namespace_ref::b4_parser_class::b4_symbol(-2, kind)[ };
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
"expected"). */
|
||||
int yycount = 0;
|
||||
|
||||
Reference in New Issue
Block a user