summaryrefslogtreecommitdiff
path: root/src/klibc/rt_vsnprintf_std.c
diff options
context:
space:
mode:
authorHaojin Tang <[email protected]>2025-09-01 14:32:03 +0800
committerR b b666 <[email protected]>2025-09-01 15:39:59 +0800
commit483117fa14612355960fa0fd353db6b1c47b3e9a (patch)
treeb8dbccaffcf4479246b3a72fddf13495b7997860 /src/klibc/rt_vsnprintf_std.c
parent728d9e491967d3691fda0d0a20dec3ac418bdc68 (diff)
fix(klibc): also check `__clang__` when detecting gcc
Diffstat (limited to 'src/klibc/rt_vsnprintf_std.c')
-rw-r--r--src/klibc/rt_vsnprintf_std.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/klibc/rt_vsnprintf_std.c b/src/klibc/rt_vsnprintf_std.c
index 583cfb715b..cedd7a9872 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
}