Paul Menzel (paulepanter@users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5388
-gerrit
commit 0a2020d1490beea49db89c38585002ded9ecc9fa Author: Paul Menzel paulepanter@users.sourceforge.net Date: Sun Mar 16 00:15:57 2014 +0100
util/cbfstool: Use `%zu` instead of `%ld` for size_t arguments
Since commit aa2f739a (cbfs: fix issues with word size and endianness.) [1] cbfstool fails to built under 32-bit platforms.
error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘size_t’
Some of these errors were fixed indirectly by subsequent patches, but not all of them.
Also no error is seen when building a coreboot image which indirectly builds cbfstool at `build/cbfstool` too.
For arguments of size_t the length modifier `z` and, as sizes are non-negative, the conversion specifier `u` should be used, so use `%zu` instead of `%ld` as the format string.
[1] http://review.coreboot.org/4817
Change-Id: Id84a20fbf237376a31f7e4816bd139463800c977 Signed-off-by: Paul Menzel paulepanter@users.sourceforge.net --- util/cbfstool/cbfs-mkstage.c | 2 +- util/cbfstool/elfheaders.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/util/cbfstool/cbfs-mkstage.c b/util/cbfstool/cbfs-mkstage.c index 6aa3746..eadc775 100644 --- a/util/cbfstool/cbfs-mkstage.c +++ b/util/cbfstool/cbfs-mkstage.c @@ -132,7 +132,7 @@ int parse_elf_to_stage(const struct buffer *input, struct buffer *output, continue; if (input->size < (phdr[i].p_offset + phdr[i].p_filesz)){ ERROR("Underflow copying out the segment." - "File has %ld bytes left, segment end is %ld\n", + "File has %zd bytes left, segment end is %zd\n", input->size, phdr[i].p_offset + phdr[i].p_filesz); return -1; } diff --git a/util/cbfstool/elfheaders.c b/util/cbfstool/elfheaders.c index f3ed05c..816278f 100644 --- a/util/cbfstool/elfheaders.c +++ b/util/cbfstool/elfheaders.c @@ -147,7 +147,7 @@ check_size(const struct buffer *b, size_t offset, size_t size, const char *desc)
if (offset >= buffer_size(b) || (offset + size) > buffer_size(b)) { ERROR("The file is not large enough for the '%s'. " - "%ld bytes @ offset %zu, input %zu bytes.\n", + "%zu bytes @ offset %zu, input %zu bytes.\n", desc, size, offset, buffer_size(b)); return -1; }