Subject: Re: [PATCH iproute2] fix print_0xhex on 32 bit

From: Stephen Hemminger <[email-masked]>
Date: Wed, 19 Dec 2018 14:02:18 -0800

On Wed, 19 Dec 2018 22:00:38 +0200
Serhey Popovych <[email-masked]> wrote:

> Stephen Hemminger wrote:
> 
> > The argument to print_0xhex is converted to unsigned long long
> > so the format string give for normal printout has to be some
> > variant of %llx. Otherwise, bogus values will be printed on
> > 32 bit platforms.  
> 
> Sorry it is too late and change is merged as commit 90c5c969f0b9
> ("fix print_0xhex on 32 bit") but I want to ask following:
> 
>   $ printf '0x%llx != %#llx\n' 0 0
>   0x0 != 0
> 
> So we potentially can get "tos 0" vs "tos 0x0" previously. Is that
> expected and will not cause any compatibility problems?
> 
> It is clear that 0 is always zero, but some code may rely on 0x form
> even for zero. What do you think?
> 
> Thanks.
> 
> 

Hmm. that is a surprise. we can change back if it matters.
Was just trying to be consistent.  Since most code that scraps is going to use strtoul(str, NULL, 16)
it shouldn't matter.