[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
glr.c patches to avoid GCC warnings
From: |
Paul Eggert |
Subject: |
glr.c patches to avoid GCC warnings |
Date: |
Fri, 10 Dec 2004 22:09:35 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
"configure --enable-gcc-warnings" reported some glitches with data/glr.c.
I installed this patch.
The only worrisome thing here is the last line. I think this was
inadvertently introduced in Akim's patch of 2004-10-25, but it'd be
nice to have another pair of eyes to check this.
2004-12-10 Paul Eggert <address@hidden>
* data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
(yyparse): Remove unused local introduced in 2004-10-25 patch.
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.82
diff -p -u -r1.82 glr.c
--- data/glr.c 27 Oct 2004 22:22:51 -0000 1.82
+++ data/glr.c 11 Dec 2004 06:01:08 -0000
@@ -704,7 +704,9 @@ yyfill (yyGLRStackItem *yyvsp, int *yylo
* yyerr for YYERROR, yyabort for YYABORT. */
static YYRESULTTAG
yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
- YYSTYPE* yyvalp, YYLTYPE* yylocp, yyGLRStack* yystack
+ YYSTYPE* yyvalp,
+ YYLTYPE* yylocp]b4_location_if(, [ ATTRIBUTE_UNUSED])[,
+ yyGLRStack* yystack
]b4_user_formals[)
{
yybool yynormal ATTRIBUTE_UNUSED = (yystack->yysplitPoint == NULL);
@@ -1702,7 +1704,9 @@ yyreportSyntaxError (yyGLRStack* yystack
value, and location of the look-ahead. */
static void
yyrecoverSyntaxError (yyGLRStack* yystack,
- YYSTYPE* yylvalp, YYLTYPE* yyllocp]b4_user_formals[)
+ YYSTYPE* yylvalp,
+ YYLTYPE* yyllocp]b4_location_if(, [ ATTRIBUTE_UNUSED])[
+ ]b4_user_formals[)
{
yySymbol* const yytokenp = yystack->yytokenp;
size_t yyk;
@@ -1923,7 +1927,6 @@ b4_syncline(address@hidden@], address@hidden@])])dnl
}
else if (yyisErrorAction (yyaction))
{
- yyGLRState *yys = yystack.yytops.yystates[0];
]b4_location_if([[ yystack.yyerror_range[0] = *yyllocp;]])[
yyreportSyntaxError (&yystack, yylvalp,
yyllocp]b4_user_args[);
goto yyuser_error;
- glr.c patches to avoid GCC warnings,
Paul Eggert <=