This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch installed for warning nits


The patch below fixes the following warnings:

 > gcc/cp/decl2.c:684: warning: `fndecl' might be used uninitialized in this function
 > gcc/cp/decl2.c:1265: warning: `decl' might be used uninitialized in this function
 > gcc/cp/pt.c:7245: warning: `template_args' might be used uninitialized in this function
 > insn-attrtab.c:14712: warning: function declaration isn't a prototype
 > gcc/genautomata.c:5276: warning: suggest explicit braces to avoid ambiguous `else'
 > gcc/local-alloc.c:2430: warning: suggest parentheses around assignment used as truth value
 > gcc/timevar.c:323: warning: implicit declaration of function `sorry'

Tested on sparc-sun-solaris2.7, no regressions.

Installed as "obvious".


2003-01-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

cp:
	* decl2.c (check_classfn): Fix uninitialized warning.
	(build_anon_union_vars): Likewise.
	* pt.c (tsubst_copy): Likewise.

gcc:
	* genattr.c (main): Rearrange output to avoid prototype warning.
	* genautomata.c (transform_3): Fix ambiguous-else warning.
	* local-alloc.c (requires_inout): Add parentheses around
	assignment used as truth-value.
	* timevar.c: Move system includes above local includes.  Include
	toplev.h
	* Makefile.in (timevar.o): Depend on toplev.h.

diff -rup orig/egcc-CVS20030113/gcc/cp/decl2.c egcc-CVS20030113/gcc/cp/decl2.c
--- orig/egcc-CVS20030113/gcc/cp/decl2.c	Fri Jan 10 16:00:25 2003
+++ egcc-CVS20030113/gcc/cp/decl2.c	Tue Jan 14 11:31:48 2003
@@ -681,7 +681,7 @@ check_classfn (tree ctype, tree function
   if (ix >= 0)
     {
       tree methods = CLASSTYPE_METHOD_VEC (ctype);
-      tree fndecls, fndecl;
+      tree fndecls, fndecl = 0;
       bool is_conv_op;
       const char *format = NULL;
       
@@ -1294,6 +1294,8 @@ build_anon_union_vars (tree object)
 	}
       else if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))
 	decl = build_anon_union_vars (ref);
+      else
+	decl = 0;
 
       if (main_decl == NULL_TREE)
 	main_decl = decl;
diff -rup orig/egcc-CVS20030113/gcc/cp/pt.c egcc-CVS20030113/gcc/cp/pt.c
--- orig/egcc-CVS20030113/gcc/cp/pt.c	Thu Jan  9 22:15:09 2003
+++ egcc-CVS20030113/gcc/cp/pt.c	Tue Jan 14 11:31:48 2003
@@ -7242,7 +7242,7 @@ tsubst_copy (t, args, complain, in_decl)
 	tree name;
 	tree qualifying_scope;
 	tree fns;
-	tree template_args;
+	tree template_args = 0;
 	bool template_id_p = false;
 
 	/* A baselink indicates a function from a base class.  The
diff -rup orig/egcc-CVS20030113/gcc/genattr.c egcc-CVS20030113/gcc/genattr.c
--- orig/egcc-CVS20030113/gcc/genattr.c	Thu Jan  9 18:17:59 2003
+++ egcc-CVS20030113/gcc/genattr.c	Tue Jan 14 12:05:08 2003
@@ -441,12 +441,12 @@ main (argc, argv)
       printf ("   unit with given code is currently reserved in given\n");
       printf ("   DFA state.  */\n");
       printf ("extern int cpu_unit_reservation_p PARAMS ((state_t, int));\n");
+      printf ("#endif\n\n");
       printf ("/* Clean insn code cache.  It should be called if there\n");
       printf ("   is a chance that condition value in a\n");
       printf ("   define_insn_reservation will be changed after\n");
       printf ("   last call of dfa_start.  */\n");
       printf ("extern void dfa_clean_insn_cache PARAMS ((void));\n\n");
-      printf ("#endif\n\n");
       printf ("/* Initiate and finish work with DFA.  They should be\n");
       printf ("   called as the first and the last interface\n");
       printf ("   functions.  */\n");
diff -rup orig/egcc-CVS20030113/gcc/genautomata.c egcc-CVS20030113/gcc/genautomata.c
--- orig/egcc-CVS20030113/gcc/genautomata.c	Thu Jan  9 18:18:00 2003
+++ egcc-CVS20030113/gcc/genautomata.c	Tue Jan 14 11:31:49 2003
@@ -5275,18 +5275,20 @@ transform_3 (regexp)
       max_seq_length = 0;
       if (regexp->mode == rm_allof)
 	for (i = 0; i < REGEXP_ALLOF (regexp)->regexps_num; i++)
-	  if (REGEXP_ALLOF (regexp)->regexps [i]->mode == rm_sequence)
-	    {
-	      seq = REGEXP_ALLOF (regexp)->regexps [i];
-	      if (max_seq_length < REGEXP_SEQUENCE (seq)->regexps_num)
-		max_seq_length = REGEXP_SEQUENCE (seq)->regexps_num;
-	    }
-	  else if (REGEXP_ALLOF (regexp)->regexps [i]->mode != rm_unit
-		   && REGEXP_ALLOF (regexp)->regexps [i]->mode != rm_nothing)
-	    {
-	      max_seq_length = 0;
-	      break;
-	    }
+	  {
+	    if (REGEXP_ALLOF (regexp)->regexps [i]->mode == rm_sequence)
+	      {
+		seq = REGEXP_ALLOF (regexp)->regexps [i];
+		if (max_seq_length < REGEXP_SEQUENCE (seq)->regexps_num)
+		  max_seq_length = REGEXP_SEQUENCE (seq)->regexps_num;
+	      }
+	    else if (REGEXP_ALLOF (regexp)->regexps [i]->mode != rm_unit
+		     && REGEXP_ALLOF (regexp)->regexps [i]->mode != rm_nothing)
+	      {
+		max_seq_length = 0;
+		break;
+	      }
+	  }
       if (max_seq_length != 0)
 	{
 	  if (max_seq_length == 1 || REGEXP_ALLOF (regexp)->regexps_num <= 1)
diff -rup orig/egcc-CVS20030113/gcc/local-alloc.c egcc-CVS20030113/gcc/local-alloc.c
--- orig/egcc-CVS20030113/gcc/local-alloc.c	Mon Jan 13 23:04:48 2003
+++ egcc-CVS20030113/gcc/local-alloc.c	Tue Jan 14 11:31:50 2003
@@ -2427,7 +2427,7 @@ requires_inout (p)
   int num_matching_alts = 0;
   int len;
 
-  for ( ; c = *p; p += len)
+  for ( ; (c = *p); p += len)
     {
       len = CONSTRAINT_LEN (c, p);
       switch (c)
diff -rup orig/egcc-CVS20030113/gcc/timevar.c egcc-CVS20030113/gcc/timevar.c
--- orig/egcc-CVS20030113/gcc/timevar.c	Mon Jan 13 23:04:58 2003
+++ egcc-CVS20030113/gcc/timevar.c	Tue Jan 14 11:31:50 2003
@@ -21,17 +21,18 @@ Software Foundation, 59 Temple Place - S
 
 #include "config.h"
 #include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "intl.h"
-#include "rtl.h"
-
 #ifdef HAVE_SYS_TIMES_H
 # include <sys/times.h>
 #endif
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
+#include "coretypes.h"
+#include "tm.h"
+#include "intl.h"
+#include "rtl.h"
+#include "toplev.h"
+
 
 #ifndef HAVE_CLOCK_T
 typedef int clock_t;
diff -rup orig/egcc-CVS20030113/gcc/Makefile.in egcc-CVS20030113/gcc/Makefile.in
--- orig/egcc-CVS20030113/gcc/Makefile.in	Mon Jan 13 16:00:20 2003
+++ egcc-CVS20030113/gcc/Makefile.in	Tue Jan 14 11:45:36 2003
@@ -1660,7 +1670,7 @@ cfglayout.o : cfglayout.c $(CONFIG_H) $(
    insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h function.h \
    cfglayout.h
 timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TIMEVAR_H) flags.h \
-   intl.h
+   intl.h toplev.h
 regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
    resource.h $(OBSTACK_H) flags.h $(TM_P_H)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]