From: Wolfgang Denk Date: Tue, 15 Sep 2009 21:36:54 +0200 Subject: [U-Boot] [PATCH] kwbimage.c: Fix compile warning when building on 32/64 bit systems In-Reply-To: <200909151213.38895.vapier@gentoo.org> References: <1253002223-16773-1-git-send-email-sr@denx.de> <200909151213.38895.vapier@gentoo.org> Message-ID: <20090915193654.61BEC832E864@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Mike Frysinger, In message <200909151213.38895.vapier@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@jpl-devvax.JPL.NASA.GOV>