From dfaf6e455621077f78d301f95de2e5dbab0f8512 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 24 Aug 2023 10:28:42 +0200 Subject: Fix printf format specifiers for 64 bit integer types In nandflipbits, nandtest and ubiscan, uint64_t integers are printed to stdout using "%llu" as a format specifier, but on platforms like x86_64, uint64_t is actually typedef'd as `unsigned long` only. For compatibillity across platforms, simply use the C99 printfs macros instead. Signed-off-by: David Oberhollenzer --- ubi-utils/ubiscan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ubi-utils') diff --git a/ubi-utils/ubiscan.c b/ubi-utils/ubiscan.c index e040bab..66af12a 100644 --- a/ubi-utils/ubiscan.c +++ b/ubi-utils/ubiscan.c @@ -264,10 +264,10 @@ int main(int argc, char * const argv[]) int from = (j == 0) ? 0 : args.bin_thresholds[j - 1]; if (j == args.nbins - 1) - printf("%-8d .. inf: %8d %8d %8llu %8d\n", + printf("%-8d .. inf: %8d %8d %8" PRIu64 " %8d\n", from, bins[j].cnt, bins[j].min, bins[j].mean, bins[j].max); else - printf("%-8d .. %8d: %8d %8d %8llu %8d\n", + printf("%-8d .. %8d: %8d %8d %8" PRIu64 " %8d\n", from, args.bin_thresholds[j] - 1, bins[j].cnt, bins[j].min, bins[j].mean, bins[j].max); } -- cgit v1.2.3