[U-Boot] [PATCH 5/7] Replace "llx" with PRIx64 to fix warnings on sandbox (MAD)

Wolfgang Denk wd at denx.de
Mon Dec 22 13:39:34 CET 2014


Dear Masahiro Yamada,

In message <1419243363-11542-6-git-send-email-yamada.m at jp.panasonic.com> you wrote:
> These must be fixed to fix sandbox at least.
> (Horrible things are happening on the other boards, of course.)
> 
> If we include <stdint.h>, we do not know 64bit-types are defined
> as "unsigned long long" or "unsigned long".
> (As for my 64bit GCC, __UINT64_TYPE__ is "long unsigned int")
> 
> We cannot hard-code "%llx" in printf() or friends anymore.
> We must always use PRIx64 etc.
> 
> (As Documentation/printk-formats.txt clearly says, Linux Kernel
> always uses "%llx" to print 64bit variables, and U-Boot used to do that.
> But we lost the convenience by commit 0d296cc and commit 4166ecb24)

I think we should reconsider these two commits, then.

The use of the PRIx?? macros is really ugly and makes the code very
hard to read.  This alone should be reason to avoid that - in addition
we deviate from the Linux kernel, so adapting code from there becomes
much more difficult.

I think we should especially strive to maintain compatibility with
Linux code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If the facts don't fit the theory, change the facts.
                                                   -- Albert Einstein


More information about the U-Boot mailing list