Skip to content

Commit 483117f

Browse files
Tang-HaojinRbb666
authored andcommitted
fix(klibc): also check __clang__ when detecting gcc
1 parent 728d9e4 commit 483117f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/klibc/rt_vsnprintf_std.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,13 +592,13 @@ static double apply_scaling(double num, struct scaling_factor normalization)
592592

593593
static double unapply_scaling(double normalized, struct scaling_factor normalization)
594594
{
595-
#if defined(__GNUC__) && !defined(__ARMCC_VERSION) /* GCC */
595+
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ARMCC_VERSION) /* GCC */
596596
// accounting for a static analysis bug in GCC 6.x and earlier
597597
#pragma GCC diagnostic push
598598
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
599599
#endif
600600
return normalization.multiply ? normalized / normalization.raw_factor : normalized * normalization.raw_factor;
601-
#if defined(__GNUC__) && !defined(__ARMCC_VERSION) /* GCC */
601+
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ARMCC_VERSION) /* GCC */
602602
#pragma GCC diagnostic pop
603603
#endif
604604
}

0 commit comments

Comments
 (0)