From d340b37602dac5e7ff72405a5234b28b9ce22498 Mon Sep 17 00:00:00 2001 From: rosenrost <52100845+rosenrost@users.noreply.github.com> Date: Mon, 16 Nov 2026 15:42:31 +0100 Subject: [PATCH] Fix compilation of strcmp() without optimization The fallback implementation used when __OPTIMIZE__ is not defined used the undeclared variables c1 and c2, so the library could not be built with -O0. Declare them as unsigned char, so that the result matches the inline version. --- sources/strcmp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/strcmp.c b/sources/strcmp.c index 87f9fc4..07db479 100644 --- a/sources/strcmp.c +++ b/sources/strcmp.c @@ -16,9 +16,11 @@ int strcmp(const char *scan1, const char *scan2) #ifdef __OPTIMIZE__ return __inline_strcmp(scan1, scan2); #else + unsigned char c1, c2; + do { - c1 = *scan1++; - c2 = *scan2++; + c1 = (unsigned char) *scan1++; + c2 = (unsigned char) *scan2++; } while (c1 && c1 == c2); return c1 - c2; #endif