From: Mike Frysinger Date: Tue, 15 Sep 2009 16:11:55 -0400 Subject: [U-Boot] [PATCH] kwbimage.c: Fix compile warning when building on 32/64 bit systems In-Reply-To: <20090915193654.61BEC832E864@gemini.denx.de> References: <1253002223-16773-1-git-send-email-sr@denx.de> <200909151213.38895.vapier@gentoo.org> <20090915193654.61BEC832E864@gemini.denx.de> Message-ID: <200909151611.58582.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday 15 September 2009 15:36:54 Wolfgang Denk wrote: > Mike Frysinger 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". i thought it was printing a u32. a sizeof() is size_t, so use %zu. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20090915/cbdf1122/attachment.pgp