mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
c: no longer require stdio.h when locations are enabled
Recent changes (in 2.7) introduced a dependency on both FILE and fprintf, which are "available" only in %debug mode. This was to define yy_location_print_, which is used only in %debug mode by the parser, but massively used by the test suite to output the locations in yyerror. Break this dependency: the test suite should define its own routines to display the locations. Eventually Bison will provide the user with a means to display locations, but not yet. * data/c.m4 (b4_yy_location_print_define): Use YYFPRINTF instead of fprintf directly. * data/yacc.c (b4_yy_location_print_define): Invoke it only in %debug mode, so that stdio.h is included (needed for FILE*), and YYFPRINTF is defined. * tests/local.at (AT_YYERROR_DECLARE, AT_YYERROR_DEFINE): Declare and define location_print and LOCATION_PRINT. * tests/actions.at, tests/existing.at, tests/glr-regression.at, * tests/input.at, tests/named-refs.at, tests/regression.at: Adjust to use them. Fix the expected line numbers (as the prologue's length has changed).
This commit is contained in:
5
NEWS
5
NEWS
@@ -41,6 +41,11 @@ GNU Bison NEWS
|
||||
This is has been fixed: yylval, yynerrs, yychar, and yylloc are now valid
|
||||
identifiers for user-provided variables.
|
||||
|
||||
*** stdio.h is no longer needed when locations are enabled (yacc.c)
|
||||
|
||||
Changes in Bison 2.7 introduced a dependency on FILE and fprintf when
|
||||
locations are enabled. This is fixed.
|
||||
|
||||
** Diagnostics reported by Bison
|
||||
|
||||
Most of these features were contributed by Théophile Ranquet and Victor
|
||||
|
||||
Reference in New Issue
Block a user