From 470c37c372b6b6a6961a3b287f609f55c15f6d4c Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Sun, 16 Mar 2014 00:15:57 +0100 Subject: util/cbfstool: Use `%zu` instead of `%ld` for size_t arguments cbfstool fails to built under 32-bit platforms since commit aa2f739a cbfs: fix issues with word size and endianness. due to the use of '%ld' format specifier on size_t, which on these platforms is only 32-bit. No error is seen though, when cbfstool is built, when building a coreboot image, where it is put in `build/cbfstool`. Use the length modifier `z` for size_t arguments, and cast to size_t where appropriate. Change-Id: Id84a20fbf237376a31f7e4816bd139463800c977 Signed-off-by: Paul Menzel Reviewed-on: http://review.coreboot.org/5388 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- util/cbfstool/cbfs-mkstage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/cbfstool/cbfs-mkstage.c') diff --git a/util/cbfstool/cbfs-mkstage.c b/util/cbfstool/cbfs-mkstage.c index 6aa3746bc7..2a92c9fb5a 100644 --- a/util/cbfstool/cbfs-mkstage.c +++ b/util/cbfstool/cbfs-mkstage.c @@ -132,8 +132,8 @@ 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", - input->size, phdr[i].p_offset + phdr[i].p_filesz); + "File has %zu bytes left, segment end is %zu\n", + input->size, (size_t)(phdr[i].p_offset + phdr[i].p_filesz)); return -1; } memcpy(buffer + (l_start - data_start), -- cgit v1.2.3