[U-Boot] [PATCH] kwbimage.c: Fix compile warning when building on 32/64 bit systems
Wolfgang Denk
wd at denx.de
Tue Sep 15 21:36:54 CEST 2009
Dear Mike Frysinger,
In message <200909151213.38895.vapier at gentoo.org> you wrote:
>
> > if (len % sizeof(uint32_t)) {
> > - printf ("Error:%s[%d] - lenght is not in multiple of %ld\n",
> > - __FUNCTION__, len, sizeof(uint32_t));
> > + printf ("Error:%s[%d] - lenght is not in multiple of %d\n",
> > + __FUNCTION__, len, (uint32_t)sizeof(uint32_t));
>
> why not do it right ? use PRIu32 from inttypes.h like POSIX intended. might
I don't think that would fix it, as PRIu32 is just "u", but what we
really need to be compatible with both 32 and 64 bit environments is
"%zu".
> as well fix the typo in the message ("length") while you're here, and use the
Ah, well spotted. Thanks.
> standardized __func__ ...
Well, ok. Next time, maybe ;-)
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
What about WRITING it first and rationalizing it afterwords? :-)
- Larry Wall in <8162 at jpl-devvax.JPL.NASA.GOV>
More information about the U-Boot
mailing list