aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Dubiec <jdx@o2.pl>2025-02-28 22:01:42 -0700
committerJeff Law <jlaw@ventanamicro.com>2025-02-28 22:02:59 -0700
commit2fc17730dcef182bba3c9d4e32fc00302ef421fe (patch)
tree725c6324994608b8548cbb083bb59fd7247ddeb8
parent20d95bfa29057104b352e5d82699edede8658499 (diff)
downloadgcc-2fc17730dcef182bba3c9d4e32fc00302ef421fe.zip
gcc-2fc17730dcef182bba3c9d4e32fc00302ef421fe.tar.gz
gcc-2fc17730dcef182bba3c9d4e32fc00302ef421fe.tar.bz2
[PATCH] H8/300: PR target/109189 Silence -Wformat warnings on Windows
This patch fixes annoying -Wformat warnings when gcc is built on Windows/MinGW64. Instead of %ld it uses HOST_WIDE_INT_PRINT_DEC macro, just like many other targets do. PR target/109189 gcc/ChangeLog: * config/h8300/h8300.cc (h8300_print_operand): Replace %ld format strings with HOST_WIDE_INT_PRINT_DEC macro in order to silence -Wformat warnings when building on Windows/MinGW64.
-rw-r--r--gcc/config/h8300/h8300.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/config/h8300/h8300.cc b/gcc/config/h8300/h8300.cc
index 00135e8..02056d0 100644
--- a/gcc/config/h8300/h8300.cc
+++ b/gcc/config/h8300/h8300.cc
@@ -1444,7 +1444,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
fprintf (file, "%sl", names_big[REGNO (x)]);
break;
case CONST_INT:
- fprintf (file, "#%ld", (-INTVAL (x)) & 0xff);
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, (-INTVAL (x)) & 0xff);
break;
default:
gcc_unreachable ();
@@ -1457,7 +1457,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
fprintf (file, "%sh", names_big[REGNO (x)]);
break;
case CONST_INT:
- fprintf (file, "#%ld", ((-INTVAL (x)) & 0xff00) >> 8);
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, ((-INTVAL (x)) & 0xff00) >> 8);
break;
default:
gcc_unreachable ();
@@ -1465,7 +1465,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
break;
case 'G':
gcc_assert (GET_CODE (x) == CONST_INT);
- fprintf (file, "#%ld", 0xff & (-INTVAL (x)));
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, 0xff & (-INTVAL (x)));
break;
case 'S':
if (GET_CODE (x) == REG)
@@ -1542,7 +1542,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
h8300_print_operand (file, x, 0);
break;
case CONST_INT:
- fprintf (file, "#%ld", ((INTVAL (x) >> 16) & 0xffff));
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, ((INTVAL (x) >> 16) & 0xffff));
break;
case CONST_DOUBLE:
{
@@ -1567,7 +1567,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
h8300_print_operand (file, x, 0);
break;
case CONST_INT:
- fprintf (file, "#%ld", INTVAL (x) & 0xffff);
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0xffff);
break;
case CONST_DOUBLE:
{
@@ -1621,7 +1621,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
break;
case 's':
if (GET_CODE (x) == CONST_INT)
- fprintf (file, "#%ld", (INTVAL (x)) & 0xff);
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, (INTVAL (x)) & 0xff);
else if (GET_CODE (x) == REG)
fprintf (file, "%s", byte_reg (x, 0));
else
@@ -1629,7 +1629,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
break;
case 't':
if (GET_CODE (x) == CONST_INT)
- fprintf (file, "#%ld", (INTVAL (x) >> 8) & 0xff);
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, (INTVAL (x) >> 8) & 0xff);
else if (GET_CODE (x) == REG)
fprintf (file, "%s", byte_reg (x, 1));
else
@@ -1637,7 +1637,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
break;
case 'w':
if (GET_CODE (x) == CONST_INT)
- fprintf (file, "#%ld", INTVAL (x) & 0xff);
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0xff);
else if (GET_CODE (x) == REG)
fprintf (file, "%s", byte_reg (x, 0));
else
@@ -1645,7 +1645,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
break;
case 'x':
if (GET_CODE (x) == CONST_INT)
- fprintf (file, "#%ld", (INTVAL (x) >> 8) & 0xff);
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, (INTVAL (x) >> 8) & 0xff);
else if (GET_CODE (x) == REG)
fprintf (file, "%s", byte_reg (x, 1));
else
@@ -1653,7 +1653,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
break;
case 'y':
if (GET_CODE (x) == CONST_INT)
- fprintf (file, "#%ld", (INTVAL (x) >> 16) & 0xff);
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, (INTVAL (x) >> 16) & 0xff);
else if (GET_CODE (x) == REG)
fprintf (file, "%s", byte_reg (x, 0));
else
@@ -1661,7 +1661,7 @@ h8300_print_operand (FILE *file, rtx x, int code)
break;
case 'z':
if (GET_CODE (x) == CONST_INT)
- fprintf (file, "#%ld", (INTVAL (x) >> 24) & 0xff);
+ fprintf (file, "#" HOST_WIDE_INT_PRINT_DEC, (INTVAL (x) >> 24) & 0xff);
else if (GET_CODE (x) == REG)
fprintf (file, "%s", byte_reg (x, 1));
else