While looking into [EMAIL PROTECTED]'s bug report I noticed an obvious
typo in yacc.c. I installed this fix:
2006-05-14 Paul Eggert <[EMAIL PROTECTED]>
* data/yacc.c (yytnamerr): Fix typo: local var should be of type
YYSIZE_T, not size_t.
* tests/regression.at (Trivial grammars): New test, to catch
the error fixed by the above patch.
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.138
diff -p -u -r1.138 yacc.c
--- data/yacc.c 14 May 2006 20:40:34 -0000 1.138
+++ data/yacc.c 15 May 2006 05:09:22 -0000
@@ -800,7 +800,7 @@ yytnamerr (char *yyres, const char *yyst
{
if (*yystr == '"')
{
- size_t yyn = 0;
+ YYSIZE_T yyn = 0;
char const *yyp = yystr;
for (;;)
Index: tests/regression.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/regression.at,v
retrieving revision 1.95
diff -p -u -r1.95 regression.at
--- tests/regression.at 23 Jan 2006 07:59:42 -0000 1.95
+++ tests/regression.at 15 May 2006 05:09:22 -0000
@@ -21,6 +21,32 @@
AT_BANNER([[Regression tests.]])
+## ------------------ ##
+## Trivial grammars. ##
+## ------------------ ##
+
+AT_SETUP([Trivial grammars])
+
+AT_DATA_GRAMMAR([input.y],
+[[%{
+void yyerror (char const *);
+int yylex (void);
+%}
+
+%error-verbose
+
+%%
+
+program: 'x';
+]])
+
+AT_CHECK([bison -o input.c input.y])
+AT_COMPILE([input.o], [-c input.c])
+
+AT_CLEANUP
+
+
+
## ------------------------- ##
## Early token definitions. ##
## ------------------------- ##