[libc-commits] [libc] [libc] suppress uninitialized werrors (PR #98710)

via libc-commits libc-commits at lists.llvm.org
Fri Jul 12 21:10:59 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Schrodinger ZHU Yifan (SchrodingerZhu)

<details>
<summary>Changes</summary>

suppress uninitialized werrors when building with gcc

---
Full diff: https://github.com/llvm/llvm-project/pull/98710.diff


1 Files Affected:

- (modified) libc/src/math/generic/tan.cpp (+2-2) 


``````````diff
diff --git a/libc/src/math/generic/tan.cpp b/libc/src/math/generic/tan.cpp
index a3bc972ef9c59..e623adb6b1d1e 100644
--- a/libc/src/math/generic/tan.cpp
+++ b/libc/src/math/generic/tan.cpp
@@ -150,7 +150,7 @@ LLVM_LIBC_FUNCTION(double, tan, (double x)) {
 
   DoubleDouble y;
   unsigned k;
-  generic::LargeRangeReduction<NO_FMA> range_reduction_large;
+  generic::LargeRangeReduction<NO_FMA> range_reduction_large{};
 
   // |x| < 2^32 (with FMA) or |x| < 2^23 (w/o FMA)
   if (LIBC_LIKELY(x_e < FPBits::EXP_BIAS + FAST_PASS_EXPONENT)) {
@@ -160,7 +160,7 @@ LLVM_LIBC_FUNCTION(double, tan, (double x)) {
       if (LIBC_UNLIKELY(x == 0.0))
         return x;
 
-      // For |x| < 2^-27, |tan(x) - x| < ulp(x)/2.
+        // For |x| < 2^-27, |tan(x) - x| < ulp(x)/2.
 #ifdef LIBC_TARGET_CPU_HAS_FMA
       return fputil::multiply_add(x, 0x1.0p-54, x);
 #else

``````````

</details>


https://github.com/llvm/llvm-project/pull/98710


More information about the libc-commits mailing list