From: Sitsofe Wheeler Date: Mon, 26 Jun 2017 23:38:59 +0000 (+0100) Subject: stat: fix printf format specifier X-Git-Tag: fio-2.99~27 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=29eb371b1d2b436e252c6e3e20981d88f7b1cd3f stat: fix printf format specifier 54c05828da413f6b4f9eec800a30624c453a4d90 introduced the printing of the number of samples but on 64 bit macOS with clang the format specifier generates warnings like: stat.c:502:4: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] (&ts->bw_stat[ddir])->samples); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by using the PRIu64 macro. Signed-off-by: Sitsofe Wheeler --- diff --git a/stat.c b/stat.c index e1c25a67..d496e8f9 100644 --- a/stat.c +++ b/stat.c @@ -497,13 +497,13 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts, } log_buf(out, " bw (%5s/s): min=%5llu, max=%5llu, per=%3.2f%%, " - "avg=%5.02f, stdev=%5.02f, samples=%5lu\n", + "avg=%5.02f, stdev=%5.02f, samples=%" PRIu64 "\n", bw_str, min, max, p_of_agg, mean, dev, (&ts->bw_stat[ddir])->samples); } if (calc_lat(&ts->iops_stat[ddir], &min, &max, &mean, &dev)) { log_buf(out, " iops : min=%5llu, max=%5llu, " - "avg=%5.02f, stdev=%5.02f, samples=%5lu\n", + "avg=%5.02f, stdev=%5.02f, samples=%" PRIu64 "\n", min, max, mean, dev, (&ts->iops_stat[ddir])->samples); } } @@ -935,12 +935,12 @@ static void show_ddir_status_terse(struct thread_stat *ts, if (ver == 5) { if (bw_stat) - log_buf(out, ";%lu", (&ts->bw_stat[ddir])->samples); + log_buf(out, ";%" PRIu64, (&ts->bw_stat[ddir])->samples); else log_buf(out, ";%lu", 0UL); if (calc_lat(&ts->iops_stat[ddir], &min, &max, &mean, &dev)) - log_buf(out, ";%llu;%llu;%f;%f;%lu", min, max, + log_buf(out, ";%llu;%llu;%f;%f;%" PRIu64, min, max, mean, dev, (&ts->iops_stat[ddir])->samples); else log_buf(out, ";%llu;%llu;%f;%f;%lu", 0ULL, 0ULL, 0.0, 0.0, 0UL);