mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
c++: avoid GCC 8 warnings
GCC 8 issues warnings whose root cause was a bit hard to find.
calc.cc: In member function 'virtual int yy::parser::parse()':
calc.cc:810:18: warning: '*((void*)&<anonymous> +8)' may be used uninitialized in this function [-Wmaybe-uninitialized]
, location (l)
^
calc.cc: In member function 'void yy::parser::yypush_(const char*, yy::parser::stack_symbol_type&)':
calc.cc:810:18: warning: '*((void*)&<anonymous> +8)' may be used uninitialized in this function [-Wmaybe-uninitialized]
, location (l)
^
calc.cc: In member function 'void yy::parser::yypush_(const char*, yy::parser::state_type, yy::parser::symbol_type&)':
calc.cc:810:18: warning: '*((void*)&<anonymous> +8)' may be used uninitialized in this function [-Wmaybe-uninitialized]
, location (l)
^
The problem is with locations that don't have a constructor, such as
Span (in calc.cc) which is POD. It is POD on purpose: so that we can
use that structure to test glr.cc which cannot use non POD in its
(C) stacks.
* data/c++.m4 (basic_symbol): Also ensure that 'location' is
initialized.
This commit is contained in:
@@ -296,7 +296,8 @@ m4_define([b4_public_types_define],
|
||||
|
||||
// basic_symbol.
|
||||
template <typename Base>
|
||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
|
||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()]b4_locations_if([
|
||||
: location ()])[
|
||||
{}
|
||||
|
||||
template <typename Base>
|
||||
|
||||
2
gnulib
2
gnulib
Submodule gnulib updated: 8635df0ac8...dd1a129ef6
Reference in New Issue
Block a user