[U-Boot] debug warning

Albert ARIBAUD albert.u.boot at aribaud.net
Wed Jul 15 22:23:34 CEST 2015


Hello York,

On Wed, 15 Jul 2015 13:02:07 -0700, York Sun <yorksun at freescale.com>
wrote:
> Simon,
> 
> Did it happen to you with this warning?
> 
> lib/fdtdec.c:108:4: warning: format ‘%x’ expects argument of type ‘unsigned
> int’, but argument 3 has type ‘fdt_size_t’ [-Wformat=]
>     debug("addr=%08lx, size=%08x\n",
>     ^
> 
> I think when we have 64-bit physical address, as defined in fdtdec.h, this debug
> statement needs to be changed. I am thinking to change the typedef fdt_addr_t to
> phys_addr_t, and fdt_size_t to phys_size_t. What do you say?

I say there is no reason to change a type just because a printf format
specifier is wrong for it when building for 64-bit.

Is there a rationale apart from the format specifier error?

If not, then What should be done is fix the specifier so that it is
correct in both 32 and 64 bits.

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list