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]

Patch for warnings on mips-irix6


The patch below gets rid of the following warnings on irix6.2.

Pay special attention to the uninitialized warning from mips.c.  That
variable appeared truly uninitialized and I totally guessed at what
the right init value should be when I found the clause where it wasn't
given a value.

 > mips.c:1272: warning: signed and unsigned type in conditional expression
 > mips.c:1272: warning: signed and unsigned type in conditional expression
 > mips.c:1272: warning: signed and unsigned type in conditional expression
 > mips.c:1272: warning: signed and unsigned type in conditional expression
 > mips.c:1272: warning: signed and unsigned type in conditional expression
 > mips.c:1272: warning: signed and unsigned type in conditional expression
 > mips.c:1272: warning: signed and unsigned type in conditional expression
 > mips.c:1272: warning: signed and unsigned type in conditional expression
 > mips.c:6325: warning: signed and unsigned type in conditional expression
 > mips.c:6326: warning: comparison between signed and unsigned
 > mips.c:6528: warning: `gp_offset' might be used uninitialized in
 >                       this function
 > irix6-libc-compat.c:83: warning: no previous prototype for `inet_ntoa'
 > irix6-libc-compat.c:96: warning: no previous prototype for `inet_lnaof'
 > irix6-libc-compat.c:107: warning: no previous prototype for `inet_netof'
 > irix6-libc-compat.c:118: warning: no previous prototype for `inet_makeaddr'
 > irix6-libc-compat.c:135: warning: no previous prototype for `semctl'
 > irix6-libc-compat.c:83: warning: no previous prototype for `inet_ntoa'
 > irix6-libc-compat.c:96: warning: no previous prototype for `inet_lnaof'
 > irix6-libc-compat.c:107: warning: no previous prototype for `inet_netof'
 > irix6-libc-compat.c:118: warning: no previous prototype for `inet_makeaddr'
 > varasm.c:507: warning: int format, different type arg (arg 3)
 > varasm.c:1557: warning: int format, different type arg (arg 3)
 > varasm.c:1882: warning: unsigned int format, different type arg (arg 3)
 > toplev.c:2529: warning: int format, different type arg (arg 3)

Bootstrapped on mips-sgi-irix6.2, okay to install?

		--Kaveh


2001-08-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* iris6.h (ASM_DECLARE_OBJECT_NAME, ASM_FINISH_DECLARE_OBJECT):
	Fix format specifier warnings.
	
	* irix6-libc-compat.c (inet_ntoa, inet_lnaof, inet_netof,
	inet_makeaddr, semctl): Prototype.

	* mips.c (compute_frame_size): Fix signed/unsigned warnings.
	(save_restore_insns): Fix uninitialized variable warning.

	* mips.h (GP_REG_OR_PSEUDO_STRICT_P): Fix signed/unsigned warning.
	(ASM_OUTPUT_BYTE): Fix format specifier warning.

diff -rup orig/egcs-CVS20010826/gcc/config/mips/iris6.h egcs-CVS20010826/gcc/config/mips/iris6.h
--- orig/egcs-CVS20010826/gcc/config/mips/iris6.h	Tue Aug 21 07:30:13 2001
+++ egcs-CVS20010826/gcc/config/mips/iris6.h	Sun Aug 26 09:02:42 2001
@@ -399,7 +399,9 @@ do									\
        size_directive_output = 1;					\
        fprintf (STREAM, "%s", SIZE_ASM_OP);				\
        assemble_name (STREAM, NAME);					\
-       fprintf (STREAM, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL)));	\
+       fprintf (STREAM, ",");						\
+       fprintf (STREAM, HOST_WIDE_INT_PRINT_DEC, int_size_in_bytes (TREE_TYPE (DECL)));	\
+       fprintf (STREAM, "\n");						\
      }									\
    mips_declare_object (STREAM, NAME, "", ":\n", 0);			\
  }									\
@@ -428,7 +430,9 @@ do {									 \
 	 size_directive_output = 1;					 \
 	 fprintf (FILE, "%s", SIZE_ASM_OP);				 \
 	 assemble_name (FILE, name);					 \
-	 fprintf (FILE, ",%d\n",  int_size_in_bytes (TREE_TYPE (DECL))); \
+	 fprintf (FILE, ",");						 \
+	 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, int_size_in_bytes (TREE_TYPE (DECL))); \
+	 fprintf (FILE, "\n");						 \
        }								 \
    } while (0)
 
diff -rup orig/egcs-CVS20010826/gcc/config/mips/irix6-libc-compat.c egcs-CVS20010826/gcc/config/mips/irix6-libc-compat.c
--- orig/egcs-CVS20010826/gcc/config/mips/irix6-libc-compat.c	Tue Jul 24 08:27:03 2001
+++ egcs-CVS20010826/gcc/config/mips/irix6-libc-compat.c	Sun Aug 26 08:43:11 2001
@@ -67,6 +67,11 @@ Boston, MA 02111-1307, USA.  */
    always 32.  */
 #define SHIFT_BITS	32
 
+extern machreg_t inet_ntoa	PARAMS ((machreg_t));
+extern machreg_t inet_lnaof	PARAMS ((machreg_t));
+extern machreg_t inet_netof	PARAMS ((machreg_t));
+extern machreg_t inet_makeaddr	PARAMS ((machreg_t, machreg_t));
+
 extern machreg_t _inet_ntoa	PARAMS ((machreg_t));
 extern machreg_t _inet_lnaof	PARAMS ((machreg_t));
 extern machreg_t _inet_netof	PARAMS ((machreg_t));
@@ -120,6 +125,7 @@ inet_makeaddr (machreg_t net, machreg_t 
 }
 
 #if _MIPS_SIM == _ABIN32
+extern machreg_t semctl		PARAMS ((machreg_t, machreg_t, machreg_t, machreg_t));
 extern machreg_t _semctl	PARAMS ((machreg_t, machreg_t, machreg_t, machreg_t));
 
 /* <sys/sem.h> has
diff -rup orig/egcs-CVS20010826/gcc/config/mips/mips.c egcs-CVS20010826/gcc/config/mips/mips.c
--- orig/egcs-CVS20010826/gcc/config/mips/mips.c	Sun Aug 26 07:13:46 2001
+++ egcs-CVS20010826/gcc/config/mips/mips.c	Sun Aug 26 08:29:42 2001
@@ -6246,7 +6246,7 @@ HOST_WIDE_INT
 compute_frame_size (size)
      HOST_WIDE_INT size;	/* # of var. bytes allocated */
 {
-  int regno;
+  unsigned int regno;
   HOST_WIDE_INT total_size;	/* # bytes that the entire frame takes up */
   HOST_WIDE_INT var_size;	/* # bytes that variables take up */
   HOST_WIDE_INT args_size;	/* # bytes that outgoing arguments take up */
@@ -6319,7 +6319,7 @@ compute_frame_size (size)
   /* We need to restore these for the handler.  */
   if (current_function_calls_eh_return)
     {
-      int i;
+      unsigned int i;
       for (i = 0; ; ++i)
 	{
 	  regno = EH_RETURN_DATA_REGNO (i);
@@ -6709,7 +6709,7 @@ save_restore_insns (store_p, large_reg, 
 	  }
     }
   else
-    base_reg_rtx = 0, base_offset  = 0;
+    base_reg_rtx = 0, base_offset  = 0, gp_offset = 0;
 
   /* Save floating point registers if needed.  */
   if (fmask)
diff -rup orig/egcs-CVS20010826/gcc/config/mips/mips.h egcs-CVS20010826/gcc/config/mips/mips.h
--- orig/egcs-CVS20010826/gcc/config/mips/mips.h	Sun Aug 19 22:19:19 2001
+++ egcs-CVS20010826/gcc/config/mips/mips.h	Sun Aug 26 08:59:28 2001
@@ -2750,7 +2750,7 @@ typedef struct mips_args {
    : GP_REG_P (regno))
 
 #define GP_REG_OR_PSEUDO_STRICT_P(regno, mode)				    \
-  BASE_REG_P((regno < FIRST_PSEUDO_REGISTER) ? regno : reg_renumber[regno], \
+  BASE_REG_P((regno < FIRST_PSEUDO_REGISTER) ? (int) regno : reg_renumber[regno], \
 	     (mode))
 
 #define GP_REG_OR_PSEUDO_NONSTRICT_P(regno, mode) \
@@ -4325,7 +4325,7 @@ do {									\
 /* This is how to output an assembler line for a numeric constant byte.  */
 
 #define ASM_OUTPUT_BYTE(STREAM,VALUE)					\
-  fprintf (STREAM, "\t.byte\t0x%x\n", (VALUE))
+  fprintf (STREAM, "\t.byte\t0x%x\n", (int)(VALUE))
 
 /* This is how to output an element of a case-vector that is absolute.  */
 


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