poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: %lx vs % PRIx64


From: Bruno Haible
Subject: Re: %lx vs % PRIx64
Date: Mon, 07 Feb 2022 17:29:12 +0100

Jose E. Marchesi wrote:
>     2022-02-05  Jose E. Marchesi  <jemarch@gnu.org>
>     
>             * poke/pk-cmd-def.c (PREP_REGEXP_PAYLOAD): Avoid using `regexp'
>             uninitialized.
>             * poke/pk-cmd-ios.c (pk_cmd_sub): Use PRIx64 instead of %lx.
>             (print_info_ios): Likewise.
>             (print_info_ios): Likewise.

In 2.0.92, i.e. with this change included, I get similar warnings on
Linux/sparc64 in 32-bit mode:

../../poke/pk-cmd-ios.c:91:27: warning: format '%lx' expects argument of type 
'long unsigned int', but argument 5 has type 'uint64_t' {aka 'long long 
unsigned int'} [-Wformat=]
../../poke/pk-cmd-ios.c:125:36: warning: format '%ld' expects argument of type 
'long int', but argument 3 has type 'uint64_t' {aka 'long long unsigned int'} 
[-Wformat=]
../../poke/pk-ios.c:209:51: warning: format '%lx' expects argument of type 
'long unsigned int', but argument 4 has type 'uint64_t' {aka 'long long 
unsigned int'} [-Wformat=]
../../poke/pk-ios.c:209:57: warning: format '%lx' expects argument of type 
'long unsigned int', but argument 5 has type 'uint64_t' {aka 'long long 
unsigned int'} [-Wformat=]

And similarly on Linux/mips in 32-bit and n32 ABIs (just the line numbers
differ):

../../poke/pk-cmd-ios.c:92:17: warning: format '%lx' expects argument of type 
'long unsigned int', but argument 5 has type 'uint64_t' [-Wformat=]
../../poke/pk-cmd-ios.c:125:3: warning: format '%ld' expects argument of type 
'long int', but argument 3 has type 'uint64_t' [-Wformat=]
../../poke/pk-ios.c:212:27: warning: format '%lx' expects argument of type 
'long unsigned int', but argument 4 has type 'uint64_t' [-Wformat=]
../../poke/pk-ios.c:212:27: warning: format '%lx' expects argument of type 
'long unsigned int', but argument 5 has type 'uint64_t' [-Wformat=]

The first of these warnings is in the line you just changed.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]