From: Wolfgang Denk Date: Tue, 15 Sep 2009 12:10:19 +0200 Subject: [U-Boot] [PATCH] kwbimage.c: Fix compile warning when building on 32/64 bit systems In-Reply-To: <1253002223-16773-1-git-send-email-sr@denx.de> References: <1253002223-16773-1-git-send-email-sr@denx.de> Message-ID: <20090915101019.3E61B832E864@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 Stefan Roese, In message <1253002223-16773-1-git-send-email-sr@denx.de> you wrote: > Commit 51003b89 [kwbimage.c: Fix compile warning when building on > 64 bit systems] changed the printf format for "sizeof(uint32_t)" > from "%d" to "%ld". This now generates the following warning on > 32 bit build systems: > > tools/kwbimage.c: In function `kwbimage_checksum32?: > tools/kwbimage.c:135: warning: format `%ld? expects type `long int?, > but argument 4 has type `unsigned int? > > The problem is that sizeof(uint32_t) has different types on 32 bit and > 64 bit build systems. This patch now changes the format to "%d" again and > casts sizeof() to uint32_t, fixing the problem on both build systems. Heh. Casts are evil. Now that both of us stabbed at this and failed it's time to remember to use "%zu" (hm... now why does this remind me of dzu? ;-) Will submit a patch ASAP. 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 I came home the other night and tried to open the door with my car keys...and the building started up. So I took it out for a drive. A cop pulled me over for speeding. He asked me where I live... "Right here". - Steven Wright