This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[AArch64] Fix printf format warning in aarch64_print_operand
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: marcus dot shawcroft at arm dot com, ian dot bolton at arm dot com
- Date: Mon, 22 Apr 2013 11:56:51 +0100
- Subject: [AArch64] Fix printf format warning in aarch64_print_operand
Hello,
This patch fixes the following warning in config/aarch64/aarch64.c:
.../gcc/config/aarch64/aarch64.c: In function âvoid aarch64_print_operand(FILE*, rtx, char)â:
.../gcc/config/aarch64/aarch64.c:3376:42: warning: format â%xâ expects argument of type âunsigned intâ, but argument 3 has type âlong unsigned intâ [-Wformat]
By adding the missing w to %wx.
Regression tested on aarch64-none-elf:aarch64.exp with no issues and
checked to ensure the warning clears.
Thanks,
James Greenhalgh
---
gcc/
2013-04-22 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/aarch64.c (aarch64_print_operand): Fix asm_fprintf
format specifier in 'X' case.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 267ba7f..34e1b7a 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -3373,7 +3373,7 @@ aarch64_print_operand (FILE *f, rtx x, char code)
output_operand_lossage ("invalid operand for '%%%c'", code);
return;
}
- asm_fprintf (f, "0x%x", UINTVAL (x));
+ asm_fprintf (f, "0x%wx", UINTVAL (x));
break;
case 'w':