bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calc.at workaround for current test failures


From: Paul Eggert
Subject: Re: calc.at workaround for current test failures
Date: 04 Aug 2003 12:13:57 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

OK, I reworked glr.c to make it a tiny bit more efficient and also to
avoid the need for the K&R rewrite, and installed this patch.  (Can
you tell that I dislike supporting K&R?  :-)

2003-08-04  Paul Eggert  <address@hidden>

        Rework code slightly to avoid gcc -Wtraditional warnings.
        * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
        The returned value is not stored in *YY0.  All callers changed.
        * src/output.c (merge_output): Adjust to the above change.

Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.222
diff -p -u -r1.222 output.c
--- src/output.c        10 Jun 2003 02:44:58 -0000      1.222
+++ src/output.c        4 Aug 2003 19:06:26 -0000
@@ -325,10 +325,10 @@ merger_output (FILE *out)
   for (n = 1, p = merge_functions; p != NULL; n += 1, p = p->next)
     {
       if (p->type[0] == '\0')
-       fprintf (out, "  case %d: yyval = %s (*yy0, *yy1); break;\n",
+       fprintf (out, "  case %d: *yy0 = %s (*yy0, *yy1); break;\n",
                 n, p->name);
       else
-       fprintf (out, "  case %d: yyval.%s = %s (*yy0, *yy1); break;\n",
+       fprintf (out, "  case %d: yy0->%s = %s (*yy0, *yy1); break;\n",
                 n, p->type, p->name);
     }
   fputs ("]])\n\n", out);
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.63
diff -p -u -r1.63 glr.c
--- data/glr.c  26 Jul 2003 14:12:28 -0000      1.63
+++ data/glr.c  4 Aug 2003 19:06:28 -0000
@@ -740,10 +740,9 @@ b4_syncline(address@hidden@], address@hidden@])
 }
 
 
-static YYSTYPE
+static void
 yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1)
 {
-  YYSTYPE yyval = *yy0;
   /* `Use' the arguments.  */
   (void) yy0;
   (void) yy1;
@@ -752,7 +751,6 @@ yyuserMerge (int yyn, YYSTYPE* yy0, YYST
     {
       b4_mergers
     }
-  return yyval;
 }
 [
                              /* Bison grammar-table manipulation.  */
@@ -1475,7 +1473,7 @@ yyresolveValue (yySemanticOption* yyopti
              YYSTYPE yyval1;
              YYLTYPE yydummy;
              YYCHK (yyresolveAction (yyp, yystack, &yyval1, 
&yydummy]b4_user_args[));
-             *yyvalp = yyuserMerge (yymerger[yyp->yyrule], yyvalp, &yyval1);
+             yyuserMerge (yymerger[yyp->yyrule], yyvalp, &yyval1);
            }
        }
       return yyok;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]