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 3.3 warnings


These warnings have already been cured on the trunk.  So I pulled the
patches to fix them from the trunk over to the 3.3 branch.

 > calls.c:2086: warning: function declaration isn't a prototype
 > loop.c:3280: warning: comparison between signed and unsigned
 > cp/decl2.c:703: warning: `fndecl' might be used uninitialized in this function
 > java/jcf-io.c:383: warning: passing arg 3 of `scandir' from incompatible pointer type
 > java/jcf-write.c:1784: warning: comparison between signed and unsigned


Bootstrapped on sparc-sun-solaris2.7 and installed as "obvious".


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

	* calls.c (fix_unsafe_tree): Prototype.
	* loop.c (loop_invariant_p): Avoid signed/unsigned warning.

cp:
	* decl2.c (check_classfn): Fix uninitialized warning.

java:
	* jcf-io.c (caching_stat): Cast the 3rd arg of scandir to void*.
	* jcf-write.c (generate_bytecode_insns): Avoid signed/unsigned
	warning.


diff -rup orig/egcc-3.3-CVS20030123/gcc/calls.c egcc-3.3-CVS20030123/gcc/calls.c
--- orig/egcc-3.3-CVS20030123/gcc/calls.c	Tue Jan 21 07:02:05 2003
+++ egcc-3.3-CVS20030123/gcc/calls.c	Fri Jan 24 14:11:29 2003
@@ -227,6 +227,7 @@ static int check_sibcall_argument_overla
 
 static int combine_pending_stack_adjustment_and_call
                                                 PARAMS ((int, struct args_size *, int));
+static tree fix_unsafe_tree		PARAMS ((tree));
 
 #ifdef REG_PARM_STACK_SPACE
 static rtx save_fixed_argument_area	PARAMS ((int, rtx, int *, int *));
diff -rup orig/egcc-3.3-CVS20030123/gcc/cp/decl2.c egcc-3.3-CVS20030123/gcc/cp/decl2.c
--- orig/egcc-3.3-CVS20030123/gcc/cp/decl2.c	Mon Jan  6 23:02:40 2003
+++ egcc-3.3-CVS20030123/gcc/cp/decl2.c	Fri Jan 24 14:11:29 2003
@@ -700,7 +700,7 @@ check_classfn (ctype, 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;
       
diff -rup orig/egcc-3.3-CVS20030123/gcc/java/jcf-io.c egcc-3.3-CVS20030123/gcc/java/jcf-io.c
--- orig/egcc-3.3-CVS20030123/gcc/java/jcf-io.c	Mon Nov 18 10:46:33 2002
+++ egcc-3.3-CVS20030123/gcc/java/jcf-io.c	Fri Jan 24 14:11:29 2003
@@ -375,11 +375,10 @@ DEFUN(caching_stat, (filename, buf),
       /* Unfortunately, scandir is not fully standardized.  In
 	 particular, the type of the function pointer passed as the
 	 third argument sometimes takes a "const struct dirent *"
-	 parameter, and sometimes just a "struct dirent *".  We rely
-	 on the ability to interchange these two types of function
-	 pointers.  */
+	 parameter, and sometimes just a "struct dirent *".  We cast
+	 to (void *) so that either way it is quietly accepted.  */
       dent->num_files = scandir (filename, &dent->files, 
-				 java_or_class_file, 
+				 (void *) java_or_class_file, 
 				 alphasort);
       *slot = dent;
     }
diff -rup orig/egcc-3.3-CVS20030123/gcc/java/jcf-write.c egcc-3.3-CVS20030123/gcc/java/jcf-write.c
--- orig/egcc-3.3-CVS20030123/gcc/java/jcf-write.c	Fri Dec 20 16:02:48 2002
+++ egcc-3.3-CVS20030123/gcc/java/jcf-write.c	Fri Jan 24 14:11:29 2003
@@ -1781,7 +1781,7 @@ generate_bytecode_insns (exp, target, st
 	       something like Integer.MIN_VALUE.  That is why delta is
 	       unsigned.  */
 	    delta = sw_state.max_case - sw_state.min_case;
-	    if (2 * sw_state.num_cases >= delta)
+	    if (2 * (unsigned) sw_state.num_cases >= delta)
 	      { /* Use tableswitch. */
 		int index = 0;
 		RESERVE (13 + 4 * (sw_state.max_case - sw_state.min_case + 1));
diff -rup orig/egcc-3.3-CVS20030123/gcc/loop.c egcc-3.3-CVS20030123/gcc/loop.c
--- orig/egcc-3.3-CVS20030123/gcc/loop.c	Thu Dec 19 16:02:55 2002
+++ egcc-3.3-CVS20030123/gcc/loop.c	Fri Jan 24 14:11:29 2003
@@ -3277,7 +3277,7 @@ loop_invariant_p (loop, x)
 	 These have always been created by the unroller and are set in
 	 the loop, hence are never invariant. */
 
-      if (REGNO (x) >= regs->num)
+      if (REGNO (x) >= (unsigned) regs->num)
 	return 0;
 
       if (regs->array[REGNO (x)].set_in_loop < 0)


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