[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GNU Bison 1.875b] testsuite: 66 67 69 70 71 72 76 105 107 109 111 1
From: |
Paul Eggert |
Subject: |
Re: [GNU Bison 1.875b] testsuite: 66 67 69 70 71 72 76 105 107 109 111 113 115 116 117 failed |
Date: |
30 Jun 2003 10:46:51 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Bruce Lilly <address@hidden> writes:
> Built on UWIN 3.1 (W2k SP3, MS VC++ 6.0 SP5).
Thanks for your bug report. Can you please try the following patches
if you have the time? They should fix the first syntax error in each
test failure. Due to cascading error messages it's hard for me to
tell whether they fix all the problems on your platform.
2003-06-20 Paul Eggert <address@hidden>
* data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
and return properly parenthesized result.
* data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
* data/yacc.c (YYLLOC_DEFAULT): Likewise.
Remove unnecessary parentheses from uses.
* doc/bison.texinfo (Location Default Action): Describe the
conventions for parentheses.
2003-06-19 Paul Eggert <address@hidden>
* data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
yyreportTree): Do not assume that size_t is the same width as int,
when printing sizes. Print sizes using an unsigned format.
Problem reported by Frank Heckenbach in
<http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
Port to Forte Developer 7 C compiler.
* data/glr.c (struct YYLTYPE): If locations are not being used,
declare a single dummy member, as empty structs do not conform
to the C standard.
(YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
the Forte Developer 7 C compiler complains that end-of-loop
code is not reached.
2003-06-17 Paul Eggert <address@hidden>
* lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
avoid warnings from picky compilers about redefinition of PARAMS.
diff -pru bison-1.875b/data/glr.c bison/data/glr.c
--- bison-1.875b/data/glr.c Mon Jun 9 19:44:58 2003
+++ bison/data/glr.c Fri Jun 20 15:52:12 2003
@@ -197,6 +197,8 @@ typedef struct YYLTYPE
int first_column;
int last_line;
int last_column;
+],[
+ char yydummy;
])[
} YYLTYPE;
# define YYLTYPE_IS_DECLARED 1
@@ -264,7 +266,7 @@ b4_syncline(address@hidden@], address@hidden@])
#define YYUNDEFTOK ]b4_undef_token_number[
#define YYMAXUTOK ]b4_user_token_number_max[
-#define YYTRANSLATE(YYX) \
+#define YYTRANSLATE(YYX) \
((YYX <= 0) ? YYEOF :
\
(unsigned)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -412,14 +414,14 @@ static const ]b4_int_type_for([b4_stos])
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(yyCurrent, yyRhs, YYN) \
- (yyCurrent).first_line = YYRHSLOC(yyRhs,1).first_line; \
- (yyCurrent).first_column = YYRHSLOC(yyRhs,1).first_column; \
- (yyCurrent).last_line = YYRHSLOC(yyRhs,YYN).last_line; \
- (yyCurrent).last_column = YYRHSLOC(yyRhs,YYN).last_column;
+ ((yyCurrent).first_line = YYRHSLOC(yyRhs, 1).first_line, \
+ (yyCurrent).first_column = YYRHSLOC(yyRhs, 1).first_column, \
+ (yyCurrent).last_line = YYRHSLOC(yyRhs, YYN).last_line, \
+ (yyCurrent).last_column = YYRHSLOC(yyRhs, YYN).last_column)
#endif
]],[
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(yyCurrent, yyRhs, YYN)
+# define YYLLOC_DEFAULT(yyCurrent, yyRhs, YYN) ((void) 0)
#endif
])[
@@ -446,7 +448,7 @@ static const int YYEMPTY = -2;
typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
#define YYCHK(YYE) \
- do { YYRESULTTAG yyflag = YYE; if (yyflag != yyok) return yyflag; }
\
+ do { YYRESULTTAG yyflag = YYE; if (yyflag != yyok) return yyflag; } \
while (0)
#if YYDEBUG
@@ -474,7 +476,7 @@ do {
\
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
+ yysymprint (stderr, \
Token, Value]b4_location_if([, Location])[); \
YYFPRINTF (stderr, "\n"); \
} \
@@ -682,7 +684,7 @@ yyuserAction (yyRuleNum yyn, int yyrhsle
# undef YYABORT
# define YYABORT return yyabort
# undef YYERROR
-# define YYERROR do { yystack->yyerrState = 0; return yyerr; } while (0)
+# define YYERROR return yyerrok, yyerr
# undef YYRECOVERING
# define YYRECOVERING (yystack->yyerrState != 0)
# undef yyclearin
@@ -691,10 +693,8 @@ yyuserAction (yyRuleNum yyn, int yyrhsle
# define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
# undef YYBACKUP
# define YYBACKUP(Token, Value)
\
- do { \
- yyerror (]b4_yyerror_args["syntax error: cannot back up"); \
- YYERROR; \
- } while (0)
+ return yyerror (]b4_yyerror_args["syntax error: cannot back up"), \
+ yyerrok, yyerr
yylow = 1;
if (yyrhslen == 0)
@@ -1019,7 +1019,8 @@ yyremoveDeletes (yyGLRStack* yystack)
yystack->yytops.yystates[yyj] = yystack->yytops.yystates[yyi];
if (yyj != yyi)
{
- YYDPRINTF ((stderr, "Rename stack %d -> %d.\n", yyi, yyj));
+ YYDPRINTF ((stderr, "Rename stack %lu -> %lu.\n",
+ (unsigned long int) yyi, (unsigned long int) yyj));
}
yyj += 1;
}
@@ -1080,7 +1081,7 @@ yyglrShiftDefer (yyGLRStack* yystack, in
* for userAction. */
static inline YYRESULTTAG
yydoAction (yyGLRStack* yystack, int yyk, yyRuleNum yyrule,
- YYSTYPE* yyvalp, YYLTYPE* yylocp]b4_user_formals[)
+ YYSTYPE* yyvalp, YYLTYPE* yylocp]b4_user_formals[)
{
int yynrhs = yyrhsLength (yyrule);
@@ -1101,7 +1102,7 @@ yydoAction (yyGLRStack* yystack, int yyk
int yyi;
yyGLRState* yys;
yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1];
- yys = yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred
+ yys = yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred
= yystack->yytops.yystates[yyk];
for (yyi = 0; yyi < yynrhs; yyi += 1)
{
@@ -1133,9 +1134,9 @@ static inline void
yy_reduce_print (size_t yyk, yyRuleNum yyrule)
{
int yyi;
- unsigned int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack %d by rule %d (line %u), ",
- yyk, yyrule - 1, yylno);
+ YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu), ",
+ (unsigned long int) yyk, yyrule - 1,
+ (unsigned long int) yyrline[yyrule]);
/* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi]));
@@ -1189,9 +1190,9 @@ yyglrReduce (yyGLRStack* yystack, size_t
yyupdateSplit (yystack, yys);
yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
YYDPRINTF ((stderr,
- "Reduced stack %d by rule #%d; action deferred. "
+ "Reduced stack %lu by rule #%d; action deferred. "
"Now in state %d.\n",
- yyk, yyrule-1, yynewLRState));
+ (unsigned long int) yyk, yyrule - 1, yynewLRState));
for (yyi = 0; yyi < yystack->yytops.yysize; yyi += 1)
if (yyi != yyk && yystack->yytops.yystates[yyi] != NULL)
{
@@ -1203,8 +1204,9 @@ yyglrReduce (yyGLRStack* yystack, size_t
{
yyaddDeferredAction (yystack, yyp, yys0,
yyrule]b4_pure_args[);
yymarkStackDeleted (yystack, yyk);
- YYDPRINTF ((stderr, "Merging stack %d into stack %d.\n",
- yyk, yyi));
+ YYDPRINTF ((stderr, "Merging stack %lu into stack %lu.\n",
+ (unsigned long int) yyk,
+ (unsigned long int) yyi));
return yyok;
}
yyp = yyp->yypred;
@@ -1348,7 +1350,7 @@ yyresolveAction (yySemanticOption* yyopt
yynrhs = yyrhsLength (yyopt->yyrule);
YYCHK (yyresolveStates (yyopt->yystate, yynrhs, yystack]b4_user_args[));
yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred = yyopt->yystate;
- return yyuserAction (yyopt->yyrule, yynrhs,
+ return yyuserAction (yyopt->yyrule, yynrhs,
yyrhsVals + YYMAXRHS + YYMAXLEFT - 1,
yyvalp, yylocp, yystack]b4_user_args[);
}
@@ -1378,9 +1380,10 @@ yyreportTree (yySemanticOption* yyx, int
yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
yyx->yyrule);
else
- YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %d .. %d>\n",
+ YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %lu .. %lu>\n",
yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
- yyx->yyrule, yys->yyposn+1, yyx->yystate->yyposn);
+ yyx->yyrule, (unsigned long int) (yys->yyposn + 1),
+ (unsigned long int) yyx->yystate->yyposn);
for (yyi = 1; yyi <= yynrhs; yyi += 1)
{
if (yystates[yyi]->yyresolved)
@@ -1389,9 +1392,10 @@ yyreportTree (yySemanticOption* yyx, int
YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]));
else
- YYFPRINTF (stderr, "%*s%s <tokens %d .. %d>\n", yyindent+2, "",
+ YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]),
- yystates[yyi-1]->yyposn+1, yystates[yyi]->yyposn);
+ (unsigned long int) (yystates[yyi - 1]->yyposn + 1),
+ (unsigned long int) yystates[yyi]->yyposn);
}
else
yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2);
@@ -1756,10 +1760,10 @@ yyrecoverSyntaxError (yyGLRStack* yystac
}
}
YYDSYMPRINTF ("Error: popping",
- yystos[yys->yylrState],
- &yys->yysemantics.yysval, &yys->yyloc);
+ yystos[yys->yylrState],
+ &yys->yysemantics.yysval, &yys->yyloc);
yydestruct (yystos[yys->yylrState],
- &yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
+ &yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
yystack->yytops.yystates[0] = yys->yypred;
yystack->yynextFree -= 1;
yystack->yyspaceLeft += 1;
@@ -1948,7 +1952,7 @@ yypstack (yyGLRStack* yystack, int yyk)
yypstates (yystack->yytops.yystates[yyk]);
}
-#define YYINDEX(YYX) \
+#define YYINDEX(YYX) \
((YYX) == NULL ? -1 : (yyGLRStackItem*) (YYX) - yystack->yyitems)
@@ -2016,6 +2020,8 @@ b4_location_if([
int first_column;
int last_line;
int last_column;
+],[
+ char yydummy;
])
} YYLTYPE;
# define YYLTYPE_IS_DECLARED 1
diff -pru bison-1.875b/data/lalr1.cc bison/data/lalr1.cc
--- bison-1.875b/data/lalr1.cc Tue Jun 3 22:53:10 2003
+++ bison/data/lalr1.cc Fri Jun 20 15:52:12 2003
@@ -170,7 +170,7 @@ b4_syncline(address@hidden@], address@hidden@])],
b4_syncline(address@hidden@], address@hidden@])[
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
- Current.end = Rhs[N].end;
+ ((Current).end = Rhs[N].end)
#endif
namespace yy
Only in bison/data/m4sugar: CVS
diff -pru bison-1.875b/data/yacc.c bison/data/yacc.c
--- bison-1.875b/data/yacc.c Sun Jun 1 20:57:39 2003
+++ bison/data/yacc.c Fri Jun 20 15:52:12 2003
@@ -501,11 +501,11 @@ while (0)
are run). */
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- Current.first_line = Rhs[1].first_line; \
- Current.first_column = Rhs[1].first_column; \
- Current.last_line = Rhs[N].last_line; \
- Current.last_column = Rhs[N].last_column;
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ ((Current).first_line = (Rhs)[1].first_line, \
+ (Current).first_column = (Rhs)[1].first_column, \
+ (Current).last_line = (Rhs)[N].last_line, \
+ (Current).last_column = (Rhs)[N].last_column)
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
@@ -983,7 +983,7 @@ yyreduce:
]b4_location_if(
[ /* Default location. */
- YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);])[
+ YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);])[
YY_REDUCE_PRINT (yyn);
switch (yyn)
]{
@@ -1180,7 +1180,7 @@ yyerrlab1:
YYDPRINTF ((stderr, "Shifting error token, "));
*++yyvsp = yylval;
-]b4_location_if([ YYLLOC_DEFAULT (yyloc, yylsp, (yylerrsp - yylsp));
+]b4_location_if([ YYLLOC_DEFAULT (yyloc, yylsp, yylerrsp - yylsp);
*++yylsp = yyloc;])[
yystate = yyn;
diff -pru bison-1.875b/lib/libiberty.h bison/lib/libiberty.h
--- bison-1.875b/lib/libiberty.h Tue Jun 17 00:08:19 2003
+++ bison/lib/libiberty.h Tue Jun 17 01:51:57 2003
@@ -23,7 +23,7 @@
#ifndef BISON_LIBIBERTY_H_
# define BISON_LIBIBERTY_H_ 1
-# define PARAMS(X) X
+# define PARAMS(Args) Args
# ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__