From: Willy Tarreau Date: Tue, 12 Apr 2022 06:16:54 +0000 (+0200) Subject: BUILD/DEBUG: lru: fix printf format in debug code X-Git-Tag: v2.6-dev6~118 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0683cd5103310bcc6b0e61dbed920c34c4ac598;p=thirdparty%2Fhaproxy.git BUILD/DEBUG: lru: fix printf format in debug code cppcheck reports in issue #1184 a type mismatch between "%d" and the unsigned int "misses" in the standalone debug code of lru.c. Let's switch to "%u". --- diff --git a/src/lru.c b/src/lru.c index f092588e3d..07ef50c431 100644 --- a/src/lru.c +++ b/src/lru.c @@ -295,7 +295,7 @@ int main(int argc, char **argv) ret += get_value(lru, statistical_prng() & 65535); } /* just for accuracy control */ - printf("ret=%llx, hits=%d, misses=%d (%d %% hits)\n", ret, total-misses, misses, (int)((float)(total-misses) * 100.0 / total)); + printf("ret=%llx, hits=%u, misses=%u (%d %% hits)\n", ret, (unsigned)(total-misses), misses, (int)((float)(total-misses) * 100.0 / total)); while (lru64_destroy(lru));