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


Tested by compiling insn-output.o and ip2k.o targetted to
ip2k-unknown-elf.

Installed as "obvious".


2003-05-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* ip2k.c (function_prologue, function_epilogue, print_operand):
	Fix format specifier warnings.
	* ip2k.md: Likewise.

diff -rup orig/egcc-CVS20030516/gcc/config/ip2k/ip2k.c egcc-CVS20030516/gcc/config/ip2k/ip2k.c
--- orig/egcc-CVS20030516/gcc/config/ip2k/ip2k.c	2003-05-14 20:01:59.000000000 -0400
+++ egcc-CVS20030516/gcc/config/ip2k/ip2k.c	2003-05-16 17:57:53.872718000 -0400
@@ -218,7 +218,8 @@ function_prologue (file, size)
      take any action based on the information.  */
 
   prologue_size = 0;
-  fprintf (file, "/* prologue: frame size=%d */\n", size);
+  fprintf (file, "/* prologue: frame size=" HOST_WIDE_INT_PRINT_DEC " */\n",
+	   size);
   
   /* Unless we're a leaf we need to save the return PC.  */
 
@@ -344,7 +345,8 @@ function_epilogue (file, size)
 
   leaf_func_p = leaf_function_p ();
   epilogue_size = 0;
-  fprintf (file, "/* epilogue: frame size=%d */\n", size);
+  fprintf (file, "/* epilogue: frame size=" HOST_WIDE_INT_PRINT_DEC " */\n",
+	   size);
 
   savelimit = (CHAIN_FRAMES) ? REG_FP : (REG_FP + 2);
   for (reg = 0; reg < savelimit; reg++)
@@ -919,11 +921,11 @@ print_operand (file, x, code)
       switch (code)
 	{
         case 'x':
-	  fprintf (file, "$%x", INTVAL (x) & 0xffff);
+	  fprintf (file, "$%x", (int)(INTVAL (x) & 0xffff));
 	  break;
 
 	case 'b':
-	  fprintf (file, "%d", INTVAL (x)); /* bit selector  */
+	  fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x)); /* bit selector  */
 	  break;
 
 	case 'e':		/* "1 << n" - e.g. "exp"  */
@@ -942,11 +944,11 @@ print_operand (file, x, code)
 	  break;
 
 	case 'H':
-	  fprintf (file, "#%d", (INTVAL (x) >> 8) & 0xff);
+	  fprintf (file, "#%d", (int)((INTVAL (x) >> 8) & 0xff));
 	  break;
 
 	case 'L':
-	  fprintf (file, "#%d", INTVAL (x) & 0xff);
+	  fprintf (file, "#%d", (int)(INTVAL (x) & 0xff));
 	  break;
 
 	case 'S':
@@ -962,7 +964,7 @@ print_operand (file, x, code)
 	  break;
 
 	default:
-	  fprintf (file, "#%d", INTVAL (x));
+	  fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
 	}
       break;
 
diff -rup orig/egcc-CVS20030516/gcc/config/ip2k/ip2k.md egcc-CVS20030516/gcc/config/ip2k/ip2k.md
--- orig/egcc-CVS20030516/gcc/config/ip2k/ip2k.md	2002-12-19 23:30:50.000000000 -0500
+++ egcc-CVS20030516/gcc/config/ip2k/ip2k.md	2003-05-16 17:59:46.222816000 -0400
@@ -977,7 +977,7 @@
 	  /* Constant can just be or-ed in. */
 	    {
 	      p += sprintf (p, \"mov\\tw,#$%2.2x\;or\\t%%0,w\",
-		            (INTVAL (operands[3]) << pos) & mask & 0xff);
+		            (int) (INTVAL (operands[3]) << pos) & mask & 0xff);
 	      return buff;
 	    }
 


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