Re: [PATCH 10/12] spu_run.2: Cast 'int' to 'unsigned int' when printing with "%x"

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

 



Hi Michael,

I think this patch of mine should not be applied.

printf() will internally reinterpret the 'int' as 'unsigned int'
anyway, and the behaviour is completely defined AFAIK.

Relevant standard: C18 §6.5.2.2 6

And in the case you do want this patch, I should have written
'unsigned int' in the cast, for consistency.

Thanks,

Alex

On 2020-09-12 01:14, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <colomar.6.4.3@xxxxxxxxx>
> ---
>   man2/spu_run.2 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/man2/spu_run.2 b/man2/spu_run.2
> index b6bc2c131..ddd03ffd3 100644
> --- a/man2/spu_run.2
> +++ b/man2/spu_run.2
> @@ -254,7 +254,7 @@ int main(void)
>        *   0x00000002 (spu was stopped due to stop\-and\-signal)
>        * | 0x12340000 (the stop\-and\-signal code)
>        */
> -    printf("SPU Status: %#08x\en", spu_status);
> +    printf("SPU Status: %#08x\en", (unsigned) spu_status);
>
>       exit(EXIT_SUCCESS);
>   }
>



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux