From cd9e1ba28d2ee5036db6bf932104d63a3eac76a7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 9 Jul 2006 07:38:12 +0000 Subject: [PATCH] * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy" so they don't collide with user-defined macros. (yy_stack_print): Don't assume that yytype_int16 promotes to int; this was never guaranteed, and now that we're using gnulib stdint, which defines int_fast16_t to long int, the problem is exposed. --- ChangeLog | 8 ++++++++ data/yacc.c | 15 +++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51e3a41e..a1823b9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-07-09 Paul Eggert + + * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy" + so they don't collide with user-defined macros. + (yy_stack_print): Don't assume that yytype_int16 promotes to int; + this was never guaranteed, and now that we're using gnulib stdint, + which defines int_fast16_t to long int, the problem is exposed. + 2006-07-08 Paul Eggert * data/c.m4 (b4_basename): Simplify a bit, since we don't diff --git a/data/yacc.c b/data/yacc.c index 2b1cadba..e297c643 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -286,9 +286,9 @@ typedef short int yytype_int16; #ifndef lint # define YYID(n) (n) #else -]b4_c_function_def([YYID], [static int], [[int i], [i]])[ +]b4_c_function_def([YYID], [static int], [[int yyi], [yyi]])[ { - return i; + return yyi; } #endif @@ -673,12 +673,15 @@ do { \ `------------------------------------------------------------------*/ ]b4_c_function_def([yy_stack_print], [static void], - [[yytype_int16 *bottom], [bottom]], - [[yytype_int16 *top], [top]])[ + [[yytype_int16 *yybottom], [yybottom]], + [[yytype_int16 *yytop], [yytop]])[ { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } -- 2.47.2