data/glr.c: Modify treatment of unused parameters to permit use

of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
This commit is contained in:
Paul Hilfinger
2005-06-07 02:47:12 +00:00
parent 73e561d51a
commit 43d3b66471
2 changed files with 14 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
* data/glr.c: Modify treatment of unused parameters to permit use
of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
Fix infringement on user name space reported by Janos Zoltan Szabo.

View File

@@ -245,6 +245,13 @@ b4_syncline([@oline@], [@ofile@])
# if !defined (__GNUC__) || __GNUC__ < 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(Spec) /* empty */
# else
]b4_location_if([# define YYOPTIONAL_LOC(Name) Name],[
# if defined (__cplusplus)
# define YYOPTIONAL_LOC(Name) /* empty */
# else
# define YYOPTIONAL_LOC(Name) Name ATTRIBUTE_UNUSED
# endif])[
# endif
#endif
@@ -719,7 +726,7 @@ yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal)
static YYRESULTTAG
yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
YYSTYPE* yyvalp,
YYLTYPE* yylocp]b4_location_if(, [ ATTRIBUTE_UNUSED])[,
YYLTYPE* YYOPTIONAL_LOC (yylocp),
yyGLRStack* yystack
]b4_user_formals[)
{
@@ -1748,7 +1755,7 @@ yyreportSyntaxError (yyGLRStack* yystack,
static void
yyrecoverSyntaxError (yyGLRStack* yystack,
YYSTYPE* yylvalp,
YYLTYPE* yyllocp]b4_location_if(, [ ATTRIBUTE_UNUSED])[
YYLTYPE* YYOPTIONAL_LOC (yyllocp)
]b4_user_formals[)
{
yySymbol* const yytokenp = yystack->yytokenp;