]> git.saurik.com Git - bison.git/commitdiff
data/glr.c: Modify treatment of unused parameters to permit use
authorPaul Hilfinger <Hilfinger@CS.Berkeley.EDU>
Tue, 7 Jun 2005 02:47:12 +0000 (02:47 +0000)
committerPaul Hilfinger <Hilfinger@CS.Berkeley.EDU>
Tue, 7 Jun 2005 02:47:12 +0000 (02:47 +0000)
  of g++ (which doesn't allow __attribute__ ((unused)) for parameters).

ChangeLog
data/glr.c

index eb2abfc15f5b1094f6ad1a6ae767d2f799c5a454..1e8215ef3e80ff9bbcc1bf7ce9281cdba7077890 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 29cd122073f84be9d23985769c47eea409e35519..56e93a97032e9a080bf3cf0961e2a9806b59eaf3 100644 (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;