
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