From 64667fe63ba9dd78adb9c4abf04bc3e4e25a0fd7 Mon Sep 17 00:00:00 2001 From: Thorsten Glaser Date: Fri, 21 Sep 2018 01:22:11 +0200 Subject: mtd-utils: Instead of doing preprocessor magic, just output off_t as long long Fix warnings abot PRIdoff_t in libmtd.c, in mtd_read (and mtd_write): In file included from ../git/lib/libmtd.c:40:0: ../git/lib/libmtd.c: In function 'mtd_read': ../git/include/common.h:110:18: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'off_t {aka long long int}' [-Wformat=] ../git/include/common.h:120:2: note: in expansion of macro 'errmsg' errmsg(fmt, ##__VA_ARGS__); \ ^~~~~~ ../git/lib/libmtd.c:1082:10: note: in expansion of macro 'sys_errmsg' return sys_errmsg("cannot seek mtd%d to offset %"PRIdoff_t, ^~~~~~~~~~ /usr/lib/klibc/include/inttypes.h:28:17: note: format string is defined here #define PRId32 "d" Signed-off-by: Thorsten Glaser Signed-off-by: David Oberhollenzer --- misc-utils/mtd_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'misc-utils/mtd_debug.c') diff --git a/misc-utils/mtd_debug.c b/misc-utils/mtd_debug.c index ac37e23..d65ad36 100644 --- a/misc-utils/mtd_debug.c +++ b/misc-utils/mtd_debug.c @@ -160,7 +160,7 @@ retry: if (buf != NULL) free(buf); close(outfd); - printf("Copied %zu bytes from address 0x%.8"PRIxoff_t" in flash to %s\n", len, offset, filename); + printf("Copied %zu bytes from address 0x%.8llx in flash to %s\n", len, (unsigned long long)offset, filename); return 0; err2: @@ -225,7 +225,7 @@ retry: if (buf != NULL) free(buf); fclose(fp); - printf("Copied %d bytes from %s to address 0x%.8"PRIxoff_t" in flash\n", len, filename, offset); + printf("Copied %d bytes from %s to address 0x%.8llx in flash\n", len, filename, (unsigned long long)offset); return 0; } -- cgit v1.2.3