diff options
author | Petr Štetiar <ynezz@true.cz> | 2019-07-19 23:04:23 +0200 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2019-07-19 23:04:23 +0200 |
commit | ff7909f69ef8f178501797ea9599a0add3f2cbd5 (patch) | |
tree | 1c1ff06f02032219caf54be33479ad1fece73668 /tools/firmware-utils/src | |
parent | 04cb651376f94388a5a7c2c9a983553f8b909824 (diff) | |
download | upstream-ff7909f69ef8f178501797ea9599a0add3f2cbd5.tar.gz upstream-ff7909f69ef8f178501797ea9599a0add3f2cbd5.tar.bz2 upstream-ff7909f69ef8f178501797ea9599a0add3f2cbd5.zip |
firmware-utils: mkfwimage: fix build failure on macOS with gcc 9
Fixes following errors:
src/mkfwimage.c:279:8: error: format specifies type 'long' but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
d->stats.st_size,
^~~~~~~~~~~~~~~~
src/mkfwimage.c:280:8: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat]
d->partition_length - d->stats.st_size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/mkfwimage.c:378:6: error: format specifies type 'unsigned long' but the argument has type 'long long' [-Werror,-Wformat]
d->stats.st_size - d->partition_length);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reported-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'tools/firmware-utils/src')
-rw-r--r-- | tools/firmware-utils/src/mkfwimage.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c index 4365fddc8b..c8737386a2 100644 --- a/tools/firmware-utils/src/mkfwimage.c +++ b/tools/firmware-utils/src/mkfwimage.c @@ -19,6 +19,7 @@ #include <sys/types.h> #include <sys/stat.h> +#include <inttypes.h> #include <fcntl.h> #include <unistd.h> #include <string.h> @@ -274,7 +275,7 @@ static void print_image_info(const image_info_t* im) for (i = 0; i < im->part_count; ++i) { const part_data_t* d = &im->parts[i]; - INFO(" %10s: %8ld bytes (free: %8ld)\n", + INFO(" %10s: %8" PRId64 " bytes (free: %8" PRId64 ")\n", d->partition_name, d->stats.st_size, d->partition_length - d->stats.st_size); @@ -373,7 +374,7 @@ static int validate_image_layout(image_info_t* im) return -3; } if (d->stats.st_size > d->partition_length) { - ERROR("File '%s' too big (%d) - max size: 0x%08X (exceeds %lu bytes)\n", + ERROR("File '%s' too big (%d) - max size: 0x%08X (exceeds %" PRId64 " bytes)\n", d->filename, i, d->partition_length, d->stats.st_size - d->partition_length); return -4; |