[PATCH] kexec, i386: Fix build warning of size_t print
Zhang Yanfei
zhangyanfei.yes at gmail.com
Sat Apr 6 01:39:40 EDT 2013
From: Zhang Yanfei <zhangyanfei at 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.
Signed-off-by: Zhang Yanfei <zhangyanfei at 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
More information about the kexec
mailing list