From 42d6ae6d07dd8abc83e59c6d9beee0f958d2b8fb Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Fri, 29 Nov 2024 20:31:45 +0800 Subject: [PATCH] memorystress:fix build warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: CC: memorystress_main.c memorystress_main.c: In function ‘global_init’: memorystress_main.c:39:26: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint32_t’ {aka ‘unsigned int’} [-Wformat=] 39 | #define MEMSTRESS_PREFIX "MemoryStress:" | ^~~~~~~~~~~~~~~ memorystress_main.c:442:22: note: in expansion of macro ‘MEMSTRESS_PREFIX’ 442 | syslog(LOG_INFO, MEMSTRESS_PREFIX "\n max_allocsize: %zu\n" | ^~~~~~~~~~~~~~~~ memorystress_main.c:443:41: note: format string is defined here 443 | " nodelen: %zu\n sleep_us: %lu\n nthreads: %zu\n debug: %s\n", | ~~^ | | | long unsigned int | %u Signed-off-by: chenrun1 --- testing/memstress/memorystress_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testing/memstress/memorystress_main.c b/testing/memstress/memorystress_main.c index fa6ff5b56..583c70154 100644 --- a/testing/memstress/memorystress_main.c +++ b/testing/memstress/memorystress_main.c @@ -440,7 +440,8 @@ static void global_init(FAR struct memorystress_global_s *global, int argc, } syslog(LOG_INFO, MEMSTRESS_PREFIX "\n max_allocsize: %zu\n" - " nodelen: %zu\n sleep_us: %lu\n nthreads: %zu\n debug: %s\n", + " nodelen: %zu\n sleep_us: %" PRIu32 "\n nthreads: %zu\n " + "debug: %s\n", global->max_allocsize, global->nodelen, global->sleep_us, global->nthreads, global->debug ? "true" : "false");