From 0add1b21543c7724bfad3a4215af4bf040b58622 Mon Sep 17 00:00:00 2001 From: Joseph Yiu <77114984+joseph-yiu@users.noreply.github.com> Date: Thu, 21 May 2026 11:48:09 +0100 Subject: [PATCH 1/2] Use PRIu32 format specifier when printing time_in_secs --- core_main.c | 2 +- coremark.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core_main.c b/core_main.c index a4beeb6..bada8f1 100644 --- a/core_main.c +++ b/core_main.c @@ -366,7 +366,7 @@ for (i = 0; i < MULTITHREAD; i++) #else ee_printf("Total time (secs): %d\n", time_in_secs(total_time)); if (time_in_secs(total_time) > 0) - ee_printf("Iterations/Sec : %d\n", + ee_printf("Iterations/Sec : %"PRIu32"\n", default_num_contexts * results[0].iterations / time_in_secs(total_time)); #endif diff --git a/coremark.h b/coremark.h index d054200..2a9a3ac 100644 --- a/coremark.h +++ b/coremark.h @@ -41,6 +41,8 @@ Original Author: Shay Gal-on #include #endif #if HAS_PRINTF +/* Adding inttypes.h (C99) to support PRIu32 in printf */ +#include #define ee_printf printf #endif From 908ed86bae8b01da51d4463220f2d39ab5ba863d Mon Sep 17 00:00:00 2001 From: Joseph Yiu <77114984+joseph-yiu@users.noreply.github.com> Date: Fri, 22 May 2026 10:13:46 +0100 Subject: [PATCH 2/2] Update fix for u32 printf following user feedback. --- core_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core_main.c b/core_main.c index bada8f1..6bc010e 100644 --- a/core_main.c +++ b/core_main.c @@ -364,7 +364,7 @@ for (i = 0; i < MULTITHREAD; i++) default_num_contexts * results[0].iterations / time_in_secs(total_time)); #else - ee_printf("Total time (secs): %d\n", time_in_secs(total_time)); + ee_printf("Total time (secs): %"PRIu32"\n", time_in_secs(total_time)); if (time_in_secs(total_time) > 0) ee_printf("Iterations/Sec : %"PRIu32"\n", default_num_contexts * results[0].iterations