bison-patches
[Top][All Lists]
Advanced

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

LR0.c patch to work around GCC warning


From: Paul Eggert
Subject: LR0.c patch to work around GCC warning
Date: Sat, 25 Dec 2004 21:37:41 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

I installed the following patch to work around a problem when GCC
warnings are enabled, and GCC issues a warning about comparing int to
size_t.

2004-12-25  Paul Eggert  <address@hidden>

        * src/LR0.c (new_itemsets): Use memset rather than zeroing by
        hand.  This avoids a warning about comparing int to size_t when
        GCC warnings are enabled.

--- LR0.c       17 Dec 2004 20:29:19 -0000      1.91
+++ LR0.c       26 Dec 2004 05:26:30 -0000      1.92
@@ -183,8 +183,7 @@ new_itemsets (state *s)
   if (trace_flag & trace_automaton)
     fprintf (stderr, "Entering new_itemsets, state = %d\n", s->number);
 
-  for (i = 0; i < nsyms; i++)
-    kernel_size[i] = 0;
+  memset (kernel_size, 0, nsyms * sizeof *kernel_size);
 
   nshifts = 0;
 




reply via email to

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