From: Joel E. Denny Date: Sat, 24 Feb 2007 05:43:35 +0000 (+0000) Subject: Use YYFPRINTF instead of fprintf where appropriate. Reported by X-Git-Tag: v2.3b~149 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/f57a753663ecb42c6c261a7542e28695b920fb70?hp=6404a5bf3fa7c19e3fff510453550e16a9777ec1 Use YYFPRINTF instead of fprintf where appropriate. Reported by Sébastien Fricker at . * THANKS: Add Sébastien Fricker. * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement. * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must accept a variable number of arguments. --- diff --git a/ChangeLog b/ChangeLog index b956d379..8f659f6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-02-24 Joel E. Denny + + Use YYFPRINTF instead of fprintf where appropriate. Reported by + Sébastien Fricker at + . + * THANKS: Add Sébastien Fricker. + * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement. + * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must + accept a variable number of arguments. + 2007-02-19 Joel E. Denny * bootstrap: Remove occurrences of .#bootmp from lib/Makefile. diff --git a/THANKS b/THANKS index 058b1037..a5a4a5a0 100644 --- a/THANKS +++ b/THANKS @@ -70,6 +70,7 @@ Raja R Harinath harinath@cs.umn.edu Richard Stallman rms@gnu.org Robert Anisko anisko_r@epita.fr Satya Kiran Popuri satyakiran@gmail.com +Sébastien Fricker sebastien.fricker@gmail.com Shura debil_urod@ngs.ru Steve Murphy murf@parsetree.com Tim Josling tej@melbpc.org.au diff --git a/data/glr.c b/data/glr.c index 5a40a313..681d856f 100644 --- a/data/glr.c +++ b/data/glr.c @@ -1442,12 +1442,12 @@ yy_reduce_print (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &]b4_rhs_value(yynrhs, yyi + 1)[ ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl b4_user_args[); - fprintf (stderr, "\n"); + YYFPRINTF (stderr, "\n"); } } #endif diff --git a/data/push.c b/data/push.c index 057e2e70..ee9aa671 100644 --- a/data/push.c +++ b/data/push.c @@ -750,12 +750,12 @@ do { \ /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &]b4_rhs_value(yynrhs, yyi + 1)[ ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl b4_user_args[); - fprintf (stderr, "\n"); + YYFPRINTF (stderr, "\n"); } } diff --git a/data/yacc.c b/data/yacc.c index 3f5ef720..4ec1f4a1 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -714,12 +714,12 @@ do { \ /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &]b4_rhs_value(yynrhs, yyi + 1)[ ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl b4_user_args[); - fprintf (stderr, "\n"); + YYFPRINTF (stderr, "\n"); } } diff --git a/doc/bison.texinfo b/doc/bison.texinfo index 03ed7f73..c39c325b 100644 --- a/doc/bison.texinfo +++ b/doc/bison.texinfo @@ -7236,7 +7236,7 @@ always possible. The trace facility outputs messages with macro calls of the form @code{YYFPRINTF (stderr, @var{format}, @var{args})} where -@var{format} and @var{args} are the usual @code{printf} format and +@var{format} and @var{args} are the usual @code{printf} format and variadic arguments. If you define @code{YYDEBUG} to a nonzero value but do not define @code{YYFPRINTF}, @code{} is automatically included and @code{YYFPRINTF} is defined to @code{fprintf}.