[U-Boot] env_onenand compiler warning

Testing recent mainline git head for omap3_evm_config I get compiler warning
env_onenand.c: In function 'saveenv': env_onenand.c:104: warning: format '%08lx' expects type 'long unsigned int', but argument 2 has type 'loff_t'
Is there already a fix available?
Thanks
Dirk

From: Alessandro Rubini rubini@gnudd.com
Since env_addr is a loff_t (long long), "%08lx" is not a good format; this uses "%08llx" (not "%016llx"), to get 8 or more hex digits. I tnknk padding to 8 digits makes things more readable for "small" numbers, and the unlikely values over 4GB are reported correctly anyways.
Signed-off-by: Alessandro Rubini rubini@gnudd.com ---
I found this during "./MAKEALL arm", and it affects my nhk8815 as well. The warning was already reported today by Dirk Behme, thus this is reply to his message.
common/env_onenand.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/env_onenand.c b/common/env_onenand.c index 476fdbc..0b03537 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -101,7 +101,7 @@ int saveenv(void) instr.addr = env_addr; instr.mtd = mtd; if (mtd->erase(mtd, &instr)) { - printf("OneNAND: erase failed at 0x%08lx\n", env_addr); + printf("OneNAND: erase failed at 0x%08llx\n", (u64)env_addr); return 1; }

Dear Alessandro Rubini,
In message 20090719151345.GA17567@mail.gnudd.com you wrote:
From: Alessandro Rubini rubini@gnudd.com
Since env_addr is a loff_t (long long), "%08lx" is not a good format; this uses "%08llx" (not "%016llx"), to get 8 or more hex digits. I tnknk padding to 8 digits makes things more readable for "small" numbers, and the unlikely values over 4GB are reported correctly anyways.
But %llx needs CONFIG_SYS_64BIT_VSPRINTF - are we sure that this is #define'd on all boards that use onenand?
Best regards,
Wolfgang Denk

Hi,
Thank you for pointing compiler warning.
I post the patch.
Thank you, Kyungmin Park
On Sun, Jul 19, 2009 at 3:47 PM, Dirk Behmedirk.behme@googlemail.com wrote:
Testing recent mainline git head for omap3_evm_config I get compiler warning
env_onenand.c: In function 'saveenv': env_onenand.c:104: warning: format '%08lx' expects type 'long unsigned int', but argument 2 has type 'loff_t'
Is there already a fix available?
Thanks
Dirk _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
participants (4)
-
Alessandro Rubini
-
Dirk Behme
-
Kyungmin Park
-
Wolfgang Denk