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

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Fri Jul 12 21:10:30 PDT 2024


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

None

>From 6721c833d1b74958fd1626483ae4a694e15f7d8d Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <i at zhuyi.fan>
Date: Fri, 12 Jul 2024 21:09:14 -0700
Subject: [PATCH] [libc] suppress uninitialized werrors

---
 libc/src/math/generic/tan.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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



More information about the libc-commits mailing list