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 --- jffsX-utils/mkfs.jffs2.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'jffsX-utils') diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c index 9aa6c39..0661786 100644 --- a/jffsX-utils/mkfs.jffs2.c +++ b/jffsX-utils/mkfs.jffs2.c @@ -1237,8 +1237,8 @@ static void recursive_populate_directory(struct filesystem_entry *dir) } else switch (e->sb.st_mode & S_IFMT) { case S_IFDIR: if (verbose) { - printf("\td %04o %9" PRIdoff_t " %5d:%-3d %s\n", - e->sb.st_mode & ~S_IFMT, e->sb.st_size, + printf("\td %04o %9lld %5d:%-3d %s\n", + e->sb.st_mode & ~S_IFMT, (long long)e->sb.st_size, (int) (e->sb.st_uid), (int) (e->sb.st_gid), e->name); } @@ -1247,8 +1247,8 @@ static void recursive_populate_directory(struct filesystem_entry *dir) break; case S_IFSOCK: if (verbose) { - printf("\ts %04o %9" PRIdoff_t " %5d:%-3d %s\n", - e->sb.st_mode & ~S_IFMT, e->sb.st_size, + printf("\ts %04o %9lld %5d:%-3d %s\n", + e->sb.st_mode & ~S_IFMT, (long long)e->sb.st_size, (int) e->sb.st_uid, (int) e->sb.st_gid, e->name); } write_pipe(e); @@ -1256,8 +1256,8 @@ static void recursive_populate_directory(struct filesystem_entry *dir) break; case S_IFIFO: if (verbose) { - printf("\tp %04o %9" PRIdoff_t " %5d:%-3d %s\n", - e->sb.st_mode & ~S_IFMT, e->sb.st_size, + printf("\tp %04o %9lld %5d:%-3d %s\n", + e->sb.st_mode & ~S_IFMT, (long long)e->sb.st_size, (int) e->sb.st_uid, (int) e->sb.st_gid, e->name); } write_pipe(e); @@ -1285,8 +1285,8 @@ static void recursive_populate_directory(struct filesystem_entry *dir) break; case S_IFLNK: if (verbose) { - printf("\tl %04o %9" PRIdoff_t " %5d:%-3d %s -> %s\n", - e->sb.st_mode & ~S_IFMT, e->sb.st_size, + printf("\tl %04o %9lld %5d:%-3d %s -> %s\n", + e->sb.st_mode & ~S_IFMT, (long long)e->sb.st_size, (int) e->sb.st_uid, (int) e->sb.st_gid, e->name, e->link); } @@ -1297,8 +1297,8 @@ static void recursive_populate_directory(struct filesystem_entry *dir) wrote = write_regular_file(e); write_xattr_entry(e); if (verbose) { - printf("\tf %04o %9" PRIdoff_t " (%9u) %5d:%-3d %s\n", - e->sb.st_mode & ~S_IFMT, e->sb.st_size, wrote, + printf("\tf %04o %9lld (%9u) %5d:%-3d %s\n", + e->sb.st_mode & ~S_IFMT, (long long)e->sb.st_size, wrote, (int) e->sb.st_uid, (int) e->sb.st_gid, e->name); } break; -- cgit v1.2.3