[PATCH] pc-bios/s390-ccw: Fix compiler warning when compiling with DEBUG enabled

Thomas Huth posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260306203645.28232-1-thuth@redhat.com
Maintainers: Christian Borntraeger <borntraeger@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Jared Rossi <jrossi@linux.ibm.com>, Zhuoying Cai <zycai@linux.ibm.com>
pc-bios/s390-ccw/s390-ccw.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] pc-bios/s390-ccw: Fix compiler warning when compiling with DEBUG enabled
Posted by Thomas Huth 1 month, 1 week ago
From: Thomas Huth <thuth@redhat.com>

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 <thuth@redhat.com>
---
 pc-bios/s390-ccw/s390-ccw.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
index b1dc35cdedf..6a0b987e303 100644
--- a/pc-bios/s390-ccw/s390-ccw.h
+++ b/pc-bios/s390-ccw/s390-ccw.h
@@ -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
 }
 
-- 
2.53.0
Re: [PATCH] pc-bios/s390-ccw: Fix compiler warning when compiling with DEBUG enabled
Posted by Farhan Ali 1 month, 1 week ago
On 3/6/2026 12:36 PM, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
>
> 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 <thuth@redhat.com>
> ---
>   pc-bios/s390-ccw/s390-ccw.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
> index b1dc35cdedf..6a0b987e303 100644
> --- a/pc-bios/s390-ccw/s390-ccw.h
> +++ b/pc-bios/s390-ccw/s390-ccw.h
> @@ -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?

Reviewed-by: Farhan Ali<alifm@linux.ibm.com>
Re: [PATCH] pc-bios/s390-ccw: Fix compiler warning when compiling with DEBUG enabled
Posted by Thomas Huth 1 month, 1 week ago
On 06/03/2026 21.45, Farhan Ali wrote:
> 
> On 3/6/2026 12:36 PM, Thomas Huth wrote:
>> From: Thomas Huth <thuth@redhat.com>
>>
>> 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 <thuth@redhat.com>
>> ---
>>   pc-bios/s390-ccw/s390-ccw.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
>> index b1dc35cdedf..6a0b987e303 100644
>> --- a/pc-bios/s390-ccw/s390-ccw.h
>> +++ b/pc-bios/s390-ccw/s390-ccw.h
>> @@ -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.

 > Reviewed-by: Farhan Ali<alifm@linux.ibm.com>

Thanks!

  Thomas