From f57a753663ecb42c6c261a7542e28695b920fb70 Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Sat, 24 Feb 2007 05:43:35 +0000 Subject: [PATCH 1/1] =?utf8?q?Use=20YYFPRINTF=20instead=20of=20fprintf=20w?= =?utf8?q?here=20appropriate.=20=20Reported=20by=20S=E9bastien=20Fricker?= =?utf8?q?=20at=20.=20*=20THANKS:=20Add=20S=E9bastien=20Fricker.=20*=20?= =?utf8?q?data/glr.c,=20data/push.c,=20data/yacc.c=20(yy=5Freduce=5Fprint)?= =?utf8?q?:=20Implement.=20*=20doc/bison.texinfo=20(Tracing):=20Make=20it?= =?utf8?q?=20clearer=20that=20YYFPRINTF=20must=20accept=20a=20variable=20n?= =?utf8?q?umber=20of=20arguments.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ChangeLog | 10 ++++++++++ THANKS | 1 + data/glr.c | 4 ++-- data/push.c | 4 ++-- data/yacc.c | 4 ++-- doc/bison.texinfo | 2 +- 6 files changed, 18 insertions(+), 7 deletions(-) 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}. -- 2.45.2