[U-Boot] [PATCH] The type expected by %zd is ssize_t, but it was being passed a size_t.

Signed-off-by: Gabe Black gabeblack@chromium.org --- common/cmd_nvedit.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 396a171..d9dc3f2 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -862,7 +862,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv " - truncated\n", MAX_ENV_SIZE); } ++size; - printf("## Info: input data size = %zd = 0x%zX\n", size, size); + printf("## Info: input data size = %zu = 0x%zX\n", size, size); }
if (chk) {

generally the subject/changelog should be more of the form:
cmd_nvedit: fix printf warning
gcc warns when using %zd with size_t types since the correct format is %zu: <insert gcc warning here>
otherwise, the change (in theory) makes perfect sense to me ... i would ack if not for the commit summary/log ;) -mike

This was necessary at one point, but I've been trying to get that warning to happen again so I can add it to the change message and it won't. These early patches were done 5 or 6 months ago with a different version of the repository, a different compiler, on a different system, etc., so it'd be tricky to figure out exactly what was triggering this before.
I think the changed version is genuinely more correct, but since I can't get gcc to complain now it doesn't seem like that serious a problem. I'd say take it or leave it as you see fit, and I'll try a few more things to see if I can get it to happen again.
Gabe
On Fri, Oct 28, 2011 at 4:23 PM, Mike Frysinger vapier@gentoo.org wrote:
generally the subject/changelog should be more of the form:
cmd_nvedit: fix printf warning
gcc warns when using %zd with size_t types since the correct format is %zu:
<insert gcc warning here>
otherwise, the change (in theory) makes perfect sense to me ... i would ack if not for the commit summary/log ;) -mike

On Monday 31 October 2011 23:09:39 Gabe Black wrote:
This was necessary at one point, but I've been trying to get that warning to happen again so I can add it to the change message and it won't. These early patches were done 5 or 6 months ago with a different version of the repository, a different compiler, on a different system, etc., so it'd be tricky to figure out exactly what was triggering this before.
I think the changed version is genuinely more correct, but since I can't get gcc to complain now it doesn't seem like that serious a problem. I'd say take it or leave it as you see fit, and I'll try a few more things to see if I can get it to happen again.
your change was correct. but it seems a newer patch by Simon includes this fix among others, so it's no longer needed. -mike
participants (3)
-
Gabe Black
-
Gabe Black
-
Mike Frysinger