From 7400e9144b6bf66c7a9f12b29ff716a4cf199e15 Mon Sep 17 00:00:00 2001 From: orbea Date: Mon, 29 May 2023 20:16:10 -0700 Subject: [PATCH] cli: Silence -Wformat warnings With GCC-13.1.1 and clang-16.0.4. cli/cli.cpp:475:51: warning: format specifies type 'long long' but the argument has type 'int64_t' (aka 'long') [-Wformat] sprintf(temp, "%lld -> %lld bytes (%.0f%%)\n", total, written, ratio); ~~~~ ^~~~~ %ld cli/cli.cpp:475:58: warning: format specifies type 'long long' but the argument has type 'int64_t' (aka 'long') [-Wformat] sprintf(temp, "%lld -> %lld bytes (%.0f%%)\n", total, written, ratio); ~~~~ ^~~~~~~ %ld --- cli/cli.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/cli.cpp b/cli/cli.cpp index 5b471fea..ab85b5c5 100644 --- a/cli/cli.cpp +++ b/cli/cli.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -472,7 +473,7 @@ int main(int argc, char *argv[]) { } else if (status == maxcso::TASK_SUCCESS) { double ratio = total == 0 ? 0.0 : (written * 100.0) / total; char temp[128]; - sprintf(temp, "%lld -> %lld bytes (%.0f%%)\n", total, written, ratio); + sprintf(temp, "%" PRId64 " -> %" PRId64 " bytes (%.0f%%)\n", total, written, ratio); statusInfo = temp; } else { // This shouldn't happen.