bison-patches
[Top][All Lists]
Advanced

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

FYI: Both: Useless vars


From: Akim Demaille
Subject: FYI: Both: Useless vars
Date: 14 Nov 2001 15:42:11 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
        defined only if yyoverflow is defined, to avoid `warning: unused
        variable `yyvs1''.
        Reported by The Test Suite.

Index: src/bison.simple
===================================================================
RCS file: /cvsroot/bison/bison/src/bison.simple,v
retrieving revision 1.53.2.4
diff -u -u -r1.53.2.4 bison.simple
--- src/bison.simple 2001/11/12 09:14:35 1.53.2.4
+++ src/bison.simple 2001/11/14 14:54:59
@@ -385,40 +385,38 @@

   if (yyssp >= yyss + yystacksize - 1)
     {
-      /* Give user a chance to reallocate the stack. Use copies of
-        these so that the &'s don't force the real ones into memory.
-        */
-      YYSTYPE *yyvs1 = yyvs;
-      short *yyss1 = yyss;
-#if YYLSP_NEEDED
-      YYLTYPE *yyls1 = yyls;
-#endif
-
       /* Get the current used size of the three stacks, in elements.  */
       int size = yyssp - yyss + 1;

 #ifdef yyoverflow
-      /* Each stack pointer address is followed by the size of the
-        data in use in that stack, in bytes.  */
-# if YYLSP_NEEDED
-      /* This used to be a conditional around just the two extra args,
-        but that might be undefined if yyoverflow is a macro.  */
-      yyoverflow ("parser stack overflow",
-                 &yyss1, size * sizeof (*yyssp),
-                 &yyvs1, size * sizeof (*yyvsp),
-                 &yyls1, size * sizeof (*yylsp),
-                 &yystacksize);
-# else
-      yyoverflow ("parser stack overflow",
-                 &yyss1, size * sizeof (*yyssp),
-                 &yyvs1, size * sizeof (*yyvsp),
-                 &yystacksize);
-# endif
+      {
+       /* Give user a chance to reallocate the stack. Use copies of
+          these so that the &'s don't force the real ones into
+          memory.  */
+       YYSTYPE *yyvs1 = yyvs;
+       short *yyss1 = yyss;

-      yyss = yyss1; yyvs = yyvs1;
+       /* Each stack pointer address is followed by the size of the
+          data in use in that stack, in bytes.  */
 # if YYLSP_NEEDED
-      yyls = yyls1;
+       YYLTYPE *yyls1 = yyls;
+       /* This used to be a conditional around just the two extra args,
+          but that might be undefined if yyoverflow is a macro.  */
+       yyoverflow ("parser stack overflow",
+                   &yyss1, size * sizeof (*yyssp),
+                   &yyvs1, size * sizeof (*yyvsp),
+                   &yyls1, size * sizeof (*yylsp),
+                   &yystacksize);
+       yyls = yyls1;
+# else
+       yyoverflow ("parser stack overflow",
+                   &yyss1, size * sizeof (*yyssp),
+                   &yyvs1, size * sizeof (*yyvsp),
+                   &yystacksize);
 # endif
+       yyss = yyss1;
+       yyvs = yyvs1;
+      }
 #else /* no yyoverflow */
       /* Extend the stack our own way.  */
       if (yystacksize >= YYMAXDEPTH)



reply via email to

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