From b02c4c1e339ed4d0b89c3c4b2c1de689ea4dd049 Mon Sep 17 00:00:00 2001 From: Haojin Tang Date: Mon, 1 Sep 2025 14:32:03 +0800 Subject: [PATCH] fix(klibc): also check `__clang__` when detecting gcc --- src/klibc/rt_vsnprintf_std.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/klibc/rt_vsnprintf_std.c b/src/klibc/rt_vsnprintf_std.c index 583cfb715be..cedd7a9872c 100644 --- a/src/klibc/rt_vsnprintf_std.c +++ b/src/klibc/rt_vsnprintf_std.c @@ -592,13 +592,13 @@ static double apply_scaling(double num, struct scaling_factor normalization) static double unapply_scaling(double normalized, struct scaling_factor normalization) { -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) /* GCC */ +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ARMCC_VERSION) /* GCC */ // accounting for a static analysis bug in GCC 6.x and earlier #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif return normalization.multiply ? normalized / normalization.raw_factor : normalized * normalization.raw_factor; -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) /* GCC */ +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ARMCC_VERSION) /* GCC */ #pragma GCC diagnostic pop #endif }