(yy_reduce_print): Don't assume that yyrline[yyrule]

promotes to int; it might be unsigned int.
This commit is contained in:
Paul Eggert
2002-12-07 05:45:46 +00:00
parent b64755e391
commit c5d128ec1a

View File

@@ -1103,8 +1103,9 @@ static inline void
yy_reduce_print (size_t yyk, yyRuleNum yyrule) yy_reduce_print (size_t yyk, yyRuleNum yyrule)
{ {
int yyi; int yyi;
YYFPRINTF (stderr, "Reducing stack %d by rule %d (line %d), ", unsigned int yylineno = yyrline[yyrule];
yyk, yyrule - 1, yyrline[yyrule]); YYFPRINTF (stderr, "Reducing stack %d by rule %d (line %u), ",
yyk, yyrule - 1, yylineno);
/* Print the symbols being reduced, and their result. */ /* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi])); YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi]));