mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
yacc.c: initialize yylval and yylloc.
When generating a pure push parser, the initialization of yylval and yylloc may not be visible to the compiler. With warnings enabled, GCC 4.3.6, 4.4.7, 4.5.4, and 4.6.3 report uninitialized uses of yylval/yylloc. Using local pragmas to disable these warnings is not supported before 4.6, and 4.6 does not support it properly. So initialize yylval and yylloc at their definition. Reported by Peter Simons. See http://lists.gnu.org/archive/html/bison-patches/2012-10/msg00133.html * data/c.m4 (b4_yyloc_default_define): New. * data/yacc.c: Use it when locations are requested. (YYLVAL_INITIALIZE): Replace by... (YY_INITIAL_VALUE): this. (yyparse): Initialize yylloc and yylval. Therefore, remove the initialization of yylloc's field. * data/glr.c: Likewise.
This commit is contained in:
11
NEWS
11
NEWS
@@ -2,6 +2,17 @@ GNU Bison NEWS
|
||||
|
||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||
|
||||
We consider compiler warnings about Bison generated parsers to be bugs.
|
||||
Rather than working around them in your own project, please consider
|
||||
reporting them to us.
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Warnings about uninitialized yylval and/or yylloc for push parsers with a
|
||||
pure interface have been fixed for GCC 4.0 up to 4.8, and Clang 2.9 to
|
||||
3.2.
|
||||
|
||||
Other issues in the test suite have been addressed.
|
||||
|
||||
* Noteworthy changes in release 2.6.4 (2012-10-23) [stable]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user