From 0d2439141a663c736423f81a73976dbc8f929ce0 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 9 Aug 2024 19:51:12 +0200 Subject: [PATCH] syscalls: avoid -Wformat warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For printing uintptr_t use %zd. benchmarks/common/syscalls.c: In function ‘_init’: benchmarks/common/syscalls.c:118:36: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘uintptr_t’ {aka ‘long unsigned int’} [-Wformat=] 118 | pbuf += sprintf(pbuf, "%s = %d\n", counter_names[i], counters[i]); | ~^ ~~~~~~~~~~~ | | | | int uintptr_t {aka long unsigned int} | %ld Signed-off-by: Heinrich Schuchardt --- benchmarks/common/syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/common/syscalls.c b/benchmarks/common/syscalls.c index 7a7b7fdf5..c545bdaad 100644 --- a/benchmarks/common/syscalls.c +++ b/benchmarks/common/syscalls.c @@ -115,7 +115,7 @@ void _init(int cid, int nc) char* pbuf = buf; for (int i = 0; i < NUM_COUNTERS; i++) if (counters[i]) - pbuf += sprintf(pbuf, "%s = %d\n", counter_names[i], counters[i]); + pbuf += sprintf(pbuf, "%s = %zd\n", counter_names[i], counters[i]); if (pbuf != buf) printstr(buf);