aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTorsten Fleischer <torfl@t-online.de>2017-02-11 17:43:31 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-02-20 13:12:47 +0100
commit5a8069113ee41cf8fecef0344abadebf9fdb4850 (patch)
tree47df36a69642d2af88dd754c02336031e876f596 /tests
parent44558d1de053cd2772b419bb306a926f07365ae6 (diff)
mtd-utils: Fix format specifier definitions for off_t and loff_t.
On 32bit systems (e.g. ARM) the size of off_t can be 4 byte and the size of loff_t 8 byte. This causes compiler warnings like the following: flash_erase.c: In function 'show_progress': flash_erase.c:56:22: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'off_t {aka long int}' [-Wformat=] bareverbose(!quiet, "\rErasing %d Kibyte @ %"PRIxoff_t" -- %2i %% complete ", and an output like this: ~# flash_erase /dev/mtd2 0 1 Erasing 64 Kibyte @ 6400000000 -- 0 % complete ~# Since the size of off_t and loff_t can differ from each other, the printf format specifier should be determined separately for both. Further the format specifiers should be based directly on the size of the particular data type. Signed-off-by: Torsten Fleischer <torfl6749@gmail.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests')
-rw-r--r--tests/mtd-tests/nandpagetest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/mtd-tests/nandpagetest.c b/tests/mtd-tests/nandpagetest.c
index faf5fe3..4145ef7 100644
--- a/tests/mtd-tests/nandpagetest.c
+++ b/tests/mtd-tests/nandpagetest.c
@@ -230,7 +230,7 @@ static int verify_eraseblock(int ebnum)
return err;
if (lseek(fd, addr, SEEK_SET) != addr) {
- fprintf(stderr, "cannot seek mtd%d to offset %"PRIdoff_t,
+ fprintf(stderr, "cannot seek mtd%d to offset %"PRIdloff_t,
mtd.mtd_num, addr);
return -1;
}