bison-patches
[Top][All Lists]
Advanced

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

GCC warnings


From: Akim Demaille
Subject: GCC warnings
Date: 28 Jun 2002 10:41:42 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
        * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
        pacify GCC.
        * src/output.c (save_row): Initialize all the variables to pacify GCC.
        (merger_output): static.

Index: src/conflicts.c
===================================================================
RCS file: /cvsroot/bison/bison/src/conflicts.c,v
retrieving revision 1.82
diff -u -u -r1.82 conflicts.c
--- src/conflicts.c 28 Jun 2002 02:26:43 -0000 1.82
+++ src/conflicts.c 28 Jun 2002 08:39:40 -0000
@@ -432,7 +432,7 @@
 int
 conflicts_total_count (void)
 {
-  int i;
+  unsigned i;
   int count;

   /* Conflicts by state.  */
@@ -445,4 +445,4 @@
       }
   return count;
 }
-
+

 /*------------------------------------------.
 | Reporting the total number of conflicts.  |
Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.169
diff -u -u -r1.169 output.c
--- src/output.c 28 Jun 2002 02:26:43 -0000 1.169
+++ src/output.c 28 Jun 2002 08:39:41 -0000
@@ -378,2 +378,2 @@
   if (! glr_parser)
     return;

-  for (j = 0; j < ntokens; j += 1)
-    if (conflrow[j])
+  for (j = 0; j < ntokens; j += 1)
+    if (conflrow[j])
       {
        conflrow[j] = conflict_list_cnt;

@@ -388,14 +388,14 @@
        for (i = 0; i < state->nlookaheads; i += 1)
          if (bitset_test (state->lookaheads[i], j)
              && actrow[j] != -state->lookaheads_rule[i]->number)
-           {
+           {
              assert (conflict_list_free > 0);
-             conflict_list[conflict_list_cnt]
+             conflict_list[conflict_list_cnt]
                = state->lookaheads_rule[i]->number;
              conflict_list_cnt += 1;
              conflict_list_free -= 1;
            }
-
+
        /* Leave a 0 at the end */
        assert (conflict_list_free > 0);
        conflict_list_cnt += 1;
@@ -519,0 +519,0 @@

          /* GLR parsers need space for conflict lists, so we can't
             default conflicted entries.  For non-conflicted entries
-            or as long as we are not building a GLR parser,
+            or as long as we are not building a GLR parser,
             actions that match the default are replaced with zero,
             which means "use the default". */

@@ -554,7 +554,7 @@
 {
   int i;
   int count;
-  short *sp;
-  short *sp1;
-  short *sp2;
-  unsigned int *sp3;
+  short *sp = NULL;
+  short *sp1 = NULL;
+  short *sp2 = NULL;
+  unsigned int *sp3 = NULL;

   count = 0;
   for (i = 0; i < ntokens; i++)
@@ -570,6 +570,6 @@
   froms[state] = sp1 = sp = XCALLOC (short, count);
   tos[state] = sp2 = XCALLOC (short, count);
   if (glr_parser)
-    conflict_tos[state] = sp3 = XCALLOC (unsigned int, count);
-  else
+    conflict_tos[state] = sp3 = XCALLOC (unsigned int, count);
+  else
     conflict_tos[state] = NULL;

   for (i = 0; i < ntokens; i++)
@@ -612,6 +612,6 @@
       conflict_list = XCALLOC (unsigned int, 1 + 2 * nconflict);
       conflict_list_free = 2 * nconflict;
       conflict_list_cnt = 1;
-    }
-  else
+    }
+  else
     conflict_list_free = conflict_list_cnt = 0;

   for (i = 0; i < nstates; ++i)
@@ -667,1 +667,1 @@
   merger_list* p;

   fputs ("m4_define([b4_mergers], \n[[", out);
-  for (n = 1, p = merge_functions; p != NULL; n += 1, p = p->next)
+  for (n = 1, p = merge_functions; p != NULL; n += 1, p = p->next)
     {
-      if (p->type[0] == '\0')
+      if (p->type[0] == '\0')
        fprintf (out, "  case %d: yyval = %s (*yy0, *yy1); break;\n",
                 n, p->name);
       else
@@ -1103,2 +1103,2 @@
   if (! glr_parser)
     return;

-  muscle_insert_unsigned_int_table ("conflict_list_heads", conflict_table,
+  muscle_insert_unsigned_int_table ("conflict_list_heads", conflict_table,
                                    conflict_table[0], 1, high+1);
-  muscle_insert_unsigned_int_table ("conflicting_rules", conflict_list,
+  muscle_insert_unsigned_int_table ("conflicting_rules", conflict_list,
                             conflict_list[0], 1, conflict_list_cnt);

   XFREE (conflict_table);
Index: src/reader.h
===================================================================
RCS file: /cvsroot/bison/bison/src/reader.h,v
retrieving revision 1.25
diff -u -u -r1.25 reader.h
--- src/reader.h 28 Jun 2002 02:26:44 -0000 1.25
+++ src/reader.h 28 Jun 2002 08:39:41 -0000
@@ -29,5 +29,5 @@
   struct merger_list* next;
   const char* name;
   const char* type;
-}
+}
 merger_list;

 typedef struct gram_control_s
@@ -80,5 +80,5 @@
                                            location_t l));
 void grammar_current_rule_dprec_set PARAMS ((int dprec,
                                            location_t l));
-void grammer_current_rule_merge_set PARAMS ((const char* name,
+void grammar_current_rule_merge_set PARAMS ((const char* name,
                                            location_t l));

 void grammar_current_rule_symbol_append PARAMS ((symbol_t *symbol,



reply via email to

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