From: Paul Eggert Date: Sat, 7 Dec 2002 05:45:46 +0000 (+0000) Subject: (yy_reduce_print): Don't assume that yyrline[yyrule] X-Git-Tag: BISON-1_875~170 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/c5d128ec1ae0141984b205183fecda0c734fcf97 (yy_reduce_print): Don't assume that yyrline[yyrule] promotes to int; it might be unsigned int. --- diff --git a/data/glr.c b/data/glr.c index ef8d731e..798b7c61 100644 --- a/data/glr.c +++ b/data/glr.c @@ -1103,8 +1103,9 @@ static inline void yy_reduce_print (size_t yyk, yyRuleNum yyrule) { int yyi; - YYFPRINTF (stderr, "Reducing stack %d by rule %d (line %d), ", - yyk, yyrule - 1, yyrline[yyrule]); + unsigned int yylineno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack %d by rule %d (line %u), ", + yyk, yyrule - 1, yylineno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi]));