Patch installed for c4x.c warnings

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Fri May 16 20:53:00 GMT 2003


Fixes some format specifier warnings.  Tested by compiling c4x.o with
targets c4x-unknown-elf and c4x-unknown-rtems.

Space padding formatted as per previous thread.

Installed as "obvious".


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

	* c4x.c (c4x_print_operand, c4x_print_operand_address): Fix format
	specifier warnings.

diff -rup orig/egcc-CVS20030516/gcc/config/c4x/c4x.c egcc-CVS20030516/gcc/config/c4x/c4x.c
--- orig/egcc-CVS20030516/gcc/config/c4x/c4x.c	2003-05-14 20:01:46.000000000 -0400
+++ egcc-CVS20030516/gcc/config/c4x/c4x.c	2003-05-16 15:20:15.794243342 -0400
@@ -1884,7 +1884,7 @@ c4x_print_operand (file, op, letter)
     case 'N':			/* Ones complement of small constant.  */
       if (code != CONST_INT)
 	fatal_insn ("c4x_print_operand: %%N inconsistency", op);
-      fprintf (file, "%d", ~INTVAL (op));
+      fprintf (file, HOST_WIDE_INT_PRINT_DEC, ~INTVAL (op));
       return;
 
     case 'K':			/* Generate ldp(k) if direct address.  */
@@ -1964,7 +1964,7 @@ c4x_print_operand (file, op, letter)
       break;
       
     case CONST_INT:
-      fprintf (file, "%d", INTVAL (op));
+      fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (op));
       break;
       
     case NE:
@@ -2053,11 +2053,11 @@ c4x_print_operand_address (file, addr)
 	  fprintf (file, "*%s++(%s)", reg_names[REGNO (op0)],
 		   reg_names[REGNO (op1)]);
 	else if (GET_CODE (XEXP (addr, 1)) == PLUS && INTVAL (op1) > 0)
-	  fprintf (file, "*%s++(%d)", reg_names[REGNO (op0)],
-		   INTVAL (op1));
+	  fprintf (file, "*%s++(" HOST_WIDE_INT_PRINT_DEC ")",
+		   reg_names[REGNO (op0)], INTVAL (op1));
 	else if (GET_CODE (XEXP (addr, 1)) == PLUS && INTVAL (op1) < 0)
-	  fprintf (file, "*%s--(%d)", reg_names[REGNO (op0)],
-		   -INTVAL (op1));
+	  fprintf (file, "*%s--(" HOST_WIDE_INT_PRINT_DEC ")",
+		   reg_names[REGNO (op0)], -INTVAL (op1));
 	else if (GET_CODE (XEXP (addr, 1)) == MINUS && REG_P (op1))
 	  fprintf (file, "*%s--(%s)", reg_names[REGNO (op0)],
 		   reg_names[REGNO (op1)]);
@@ -2075,11 +2075,11 @@ c4x_print_operand_address (file, addr)
 	  fprintf (file, "*++%s(%s)", reg_names[REGNO (op0)],
 		   reg_names[REGNO (op1)]);
 	else if (GET_CODE (XEXP (addr, 1)) == PLUS && INTVAL (op1) > 0)
-	  fprintf (file, "*++%s(%d)", reg_names[REGNO (op0)],
-		   INTVAL (op1));
+	  fprintf (file, "*++%s(" HOST_WIDE_INT_PRINT_DEC ")",
+		   reg_names[REGNO (op0)], INTVAL (op1));
 	else if (GET_CODE (XEXP (addr, 1)) == PLUS && INTVAL (op1) < 0)
-	  fprintf (file, "*--%s(%d)", reg_names[REGNO (op0)],
-		   -INTVAL (op1));
+	  fprintf (file, "*--%s(" HOST_WIDE_INT_PRINT_DEC ")",
+		   reg_names[REGNO (op0)], -INTVAL (op1));
 	else if (GET_CODE (XEXP (addr, 1)) == MINUS && REG_P (op1))
 	  fprintf (file, "*--%s(%s)", reg_names[REGNO (op0)],
 		   reg_names[REGNO (op1)]);
@@ -2120,13 +2120,13 @@ c4x_print_operand_address (file, addr)
 	      }
 	    else if (INTVAL (op1) < 0)
 	      {
-		fprintf (file, "*-%s(%d)",
+		fprintf (file, "*-%s(" HOST_WIDE_INT_PRINT_DEC ")",
 			 reg_names[REGNO (op0)],
 			 -INTVAL (op1));	/* Base - displacement.  */
 	      }
 	    else
 	      {
-		fprintf (file, "*+%s(%d)",
+		fprintf (file, "*+%s(" HOST_WIDE_INT_PRINT_DEC ")",
 			 reg_names[REGNO (op0)],
 			 INTVAL (op1));	/* Base + displacement.  */
 	      }



More information about the Gcc-patches mailing list