From dc30ce5366ad6e4f72d9e1d3632b945f34c9d6dd Mon Sep 17 00:00:00 2001 From: anth64 Date: Sun, 1 Feb 2026 01:39:01 +0100 Subject: [PATCH] fix: cast size_t to unsigned long in printf format specifiers Prevent potential format string mismatches on platforms where size_t and unsigned long may have different sizes by explicitly casting size_t variables to unsigned long when using %lu format specifier in printf calls. --- test/test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.c b/test/test.c index f923664..d017a98 100644 --- a/test/test.c +++ b/test/test.c @@ -55,12 +55,12 @@ int main(int argc, char **argv) while (!stop) { size_t events = stk_poll(); if (events > 0) - printf("Poll: %lu module event(s) detected\n", events); + printf("Poll: %lu module event(s) detected\n", (unsigned long) events); iterations++; if (iterations % 5 == 0) { printf("Still running... (iteration %lu)\n", - iterations); + (unsigned long) iterations); } #ifdef _WIN32 Sleep(1000);