소스 검색

fix(klibc): also check `__clang__` when detecting gcc

Haojin Tang 2 주 전
부모
커밋
483117fa14
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/klibc/rt_vsnprintf_std.c

+ 2 - 2
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
 }