From 43d3b66471774fc5ec562ba35416f5ee5bae98c0 Mon Sep 17 00:00:00 2001 From: Paul Hilfinger Date: Tue, 7 Jun 2005 02:47:12 +0000 Subject: [PATCH] data/glr.c: Modify treatment of unused parameters to permit use of g++ (which doesn't allow __attribute__ ((unused)) for parameters). --- ChangeLog | 5 +++++ data/glr.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb2abfc1..1e8215ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-06-06 Paul Hilfinger + + * 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 Fix infringement on user name space reported by Janos Zoltan Szabo. diff --git a/data/glr.c b/data/glr.c index 29cd1220..56e93a97 100644 --- a/data/glr.c +++ b/data/glr.c @@ -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; -- 2.45.2