diff options
author | Thorsten Glaser <tg@mirbsd.org> | 2018-09-21 01:22:11 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2018-10-02 14:00:28 +0200 |
commit | 64667fe63ba9dd78adb9c4abf04bc3e4e25a0fd7 (patch) | |
tree | 3b357842ca9b9411cff5e2df7db45aac1e838e2c /tests/ubi-tests | |
parent | 38a6e3e29d90e11c3d5147e609d7b8e021b2cabf (diff) |
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 <tg@mirbsd.org>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/ubi-tests')
-rw-r--r-- | tests/ubi-tests/integ.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/ubi-tests/integ.c b/tests/ubi-tests/integ.c index 26c2ce5..1cd0649 100644 --- a/tests/ubi-tests/integ.c +++ b/tests/ubi-tests/integ.c @@ -243,7 +243,7 @@ static void check_erase_block(struct erase_block_info *erase_block, int fd) while (size) if (read_buffer[--size] != 0xff) { fprintf(stderr, "block no. = %d\n" , erase_block->block_number); - fprintf(stderr, "offset = %"PRIdoff_t"\n" , gap_start); + fprintf(stderr, "offset = %lld\n" , (long long)gap_start); fprintf(stderr, "size = %ld\n" , (long) bytes_read); error_exit("verify 0xff failed"); } @@ -254,7 +254,7 @@ static void check_erase_block(struct erase_block_info *erase_block, int fd) errno = 0; bytes_read = read(fd, read_buffer, w->size); if (bytes_read != w->size) { - fprintf(stderr, "offset = %"PRIdoff_t"\n" , w->offset); + fprintf(stderr, "offset = %lld\n" , (long long)w->offset); fprintf(stderr, "size = %ld\n" , (long) w->size); fprintf(stderr, "bytes_read = %ld\n" , (long) bytes_read); error_exit("read failed"); @@ -279,7 +279,7 @@ static void check_erase_block(struct erase_block_info *erase_block, int fd) while (size) if (read_buffer[--size] != 0xff) { fprintf(stderr, "block no. = %d\n" , erase_block->block_number); - fprintf(stderr, "offset = %"PRIdoff_t"\n" , gap_start); + fprintf(stderr, "offset = %lld\n" , (long long)gap_start); fprintf(stderr, "size = %ld\n" , (long) bytes_read); error_exit("verify 0xff failed!"); } |