Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
To: Simon Horman <horms@verge.net.au>
Cc: "kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	Zhang Yanfei <zhangyanfei.yes@gmail.com>
Subject: Re: [PATCH] kexec, i386: Fix build warning of size_t print
Date: Mon, 08 Apr 2013 09:38:49 +0800	[thread overview]
Message-ID: <51621FA9.80403@cn.fujitsu.com> (raw)
In-Reply-To: <20130408013736.GB13103@verge.net.au>

于 2013年04月08日 09:37, Simon Horman 写道:
> On Sat, Apr 06, 2013 at 01:39:40PM +0800, Zhang Yanfei wrote:
>> From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
>>
>> When compile kexec-tools in i386, we got the following warnings:
>>
>> kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
>> kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
>> kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
>> kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
>>
>> This is because the two functions output a size_t value as %ld
>> when it should be %zd, resulting in this warning.
> 
> Thanks,
> 
> This change looks good to me, however, the patch does
> not appear to apply on the master branch of the kexec-tools tree.
> Could you rebase and repost it?

Really? Maybe I made some mistake. Anyway I will regenerate it and
resend it again.

Thanks
Zhang

> 
>>
>> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
>> ---
>>  kexec/kexec-elf-rel.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/kexec/kexec-elf-rel.c b/kexec/kexec-elf-rel.c
>> index 38e34ec..6acd50d 100644
>> --- a/kexec/kexec-elf-rel.c
>> +++ b/kexec/kexec-elf-rel.c
>> @@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
>>                         name);
>>         }
>>         if (sym.st_size != size) {
>> -               die("Symbol: %s has size: %lld not %ld\n",
>> +               die("Symbol: %s has size: %lld not %zd\n",
>>                         name, sym.st_size, size);
>>         }
>>         shdr = &ehdr->e_shdr[sym.st_shndx];
>> @@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
>>                 die("Symbol: %s not found cannot get\n", name);
>>         }
>>         if (sym.st_size != size) {
>> -               die("Symbol: %s has size: %lld not %ld\n",
>> +               die("Symbol: %s has size: %lld not %zd\n",
>>                         name, sym.st_size, size);
>>         }
>>         shdr = &ehdr->e_shdr[sym.st_shndx];
>> -- 
>> 1.7.1
>>
> 


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2013-04-08  1:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-06  5:39 [PATCH] kexec, i386: Fix build warning of size_t print Zhang Yanfei
2013-04-08  1:37 ` Simon Horman
2013-04-08  1:38   ` Zhang Yanfei [this message]
2013-04-08  2:08     ` Simon Horman
2013-04-08  2:11       ` Zhang Yanfei
2013-04-08  3:33         ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51621FA9.80403@cn.fujitsu.com \
    --to=zhangyanfei@cn.fujitsu.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=zhangyanfei.yes@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox