]> git.saurik.com Git - bison.git/commitdiff
(grammar_rule_check): Rewrite slightly to avoid GCC warnings.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 28 Dec 2005 08:31:22 +0000 (08:31 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 28 Dec 2005 08:31:22 +0000 (08:31 +0000)
src/reader.c

index 877e2c71460941115310367f502a8fc9f79ddaa4..0e0a8c21bebecb0588e8b20fdd628f00f0ea7452 100644 (file)
@@ -247,17 +247,19 @@ grammar_rule_check (const symbol_list *r)
 
   /* Check that typed symbol values are used.  */
   {
-    symbol_list *l = r;
+    symbol_list const *l = r;
     int n = 0;
     for (; l && l->sym; l = l->next, ++n)
       if (! (l->used
             || !l->sym->type_name
             /* The default action, $$ = $1, `uses' both.  */
-            || !r->action && (n == 0 || n == 1)))
-       if (n)
-         warn_at (r->location, _("unused value: $%d"), n);
-       else
-         warn_at (r->location, _("unset value: $$"));
+            || (!r->action && (n == 0 || n == 1))))
+       {
+         if (n)
+           warn_at (r->location, _("unused value: $%d"), n);
+         else
+           warn_at (r->location, _("unset value: $$"));
+       }
   }
 }