pc-bios/s390-ccw: Fix compiler warning when compiling with DEBUG enabled
PATCH 1/1 pc-bios/s390-ccw: Fix compiler warning when compiling with DEBUG enabled
From: Thomas Huth <[email protected]>
When compiling with DEBUG=1, there is currently a compiler warning:
pc-bios/s390-ccw: Compiling main.o
In file included from /home/thuth/devel/qemu/pc-bios/s390-ccw/main.c:14:
In file included from /home/thuth/devel/qemu/pc-bios/s390-ccw/helper.h:16:
/home/thuth/devel/qemu/pc-bios/s390-ccw/s390-ccw.h:122:31: warning: format specifies type
'unsigned int' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
122 | printf("%s 0x%X\n", desc, addr);
| ~~ ^~~~
| %llX1 warning generated.
Fix it by using the right format string here.
--- pc-bios/s390-ccw/s390-ccw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/s390-ccw/s390-ccw.h +1 -1
@@ -119,7 +119,7 @@ static inline void fill_hex_val(char *out, void *ptr, unsigned size)static inline void debug_print_int (const char *desc,u64 addr) {#ifdef DEBUG -printf ("%s 0x%X\n" , desc, addr); +printf ("%s 0x%llx\n" , desc, addr);#endif }
Signature · 1 line
2.53.0
Quoted 26 lines · Thomas Huth
From: Thomas Huth <[email protected]>
When compiling with DEBUG=1, there is currently a compiler warning:
pc-bios/s390-ccw: Compiling main.o
In file included from/home/thuth/devel/qemu/pc-bios/s390-ccw/main.c:14:
In file included from/home/thuth/devel/qemu/pc-bios/s390-ccw/helper.h:16:
/home/thuth/devel/qemu/pc-bios/s390-ccw/s390-ccw.h:122:31: warning: format specifies type
'unsigned int' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat]
122 |printf("%s 0x%X\n", desc, addr);
| ~~ ^~~~
| %llX
1 warning generated.Fix it by using the right format string here.
Signed-off-by Thomas Huth <[email protected]>--- pc-bios/s390-ccw/s390-ccw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)pc-bios/s390-ccw/s390-ccw.h +0
-0
pc-bios/s390-ccw/s390-ccw.h static inline void fill_hex_val(char *out, void *ptr, unsigned size) · line 125
Quoted 8 lines
pc-bios/s390-ccw/s390-ccw.h +1
-1@@ -119,7 +119,7 @@ static inline void fill_hex_val(char *out, void *ptr, unsigned size)static inline void debug_print_int (const char *desc,u64 addr) {#ifdef DEBUG -printf ("%s 0x%X\n" , desc, addr); +printf ("%s 0x%llx\n" , desc, addr);#endif }
I am curious, this change has been there for at least 2 years...any reason the compiler tripped now? Or we never built with DEBUG=1 before?
Quoted 23 lines · Farhan Ali
Quoted 21 lines · Thomas Huth
From: Thomas Huth <[email protected]>
When compiling with DEBUG=1, there is currently a compiler warning:
pc-bios/s390-ccw: Compiling main.o
In file included from/home/thuth/devel/qemu/pc-bios/s390-ccw/main.c:14:
In file included from/home/thuth/devel/qemu/pc-bios/s390-ccw/helper.h:16:
/home/thuth/devel/qemu/pc-bios/s390-ccw/s390-ccw.h:122:31: warning: format specifies type 'unsigned int' but the argument has type 'u64' (aka 'unsigned long long') [-Wformat] 122 |printf("%s 0x%X\n", desc, addr);
| ~~ ^~~~
| %llX
1 warning generated.Fix it by using the right format string here.
Signed-off-by Thomas Huth <[email protected]>---
pc-bios/s390-ccw/s390-ccw.h| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
pc-bios/s390-ccw/s390-ccw.h static inline void fill_hex_val(char *out, void *ptr, · line 125
Quoted 13 lines
pc-bios/s390-ccw/s390-ccw.h +1
-1@@ -119,7 +119,7 @@ static inline void fill_hex_val(char *out, void *ptr, unsigned size) static inline void debug_print_int(const char *desc, u64 addr) { #ifdef DEBUG - printf("%s 0x%X\n", desc, addr); + printf("%s 0x%llx\n", desc, addr); #endif }I am curious, this change has been there for at least 2 years...any reason the compiler tripped now? Or we never built with DEBUG=1 before?
The pc-bios is rather low traffic - I guess nobody really tried compiling with DEBUG=1 within the last two years.
Quoted 1 line
Reviewed-by Farhan Ali<[email protected]>
Thanks!
Thomas