[libc-commits] [libc] [libc] Fixing float128 UB error (PR #211593)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 28 13:49:39 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- libc/src/__support/FPUtil/dyadic_float.h libc/src/__support/FPUtil/float128.h libc/test/src/__support/FPUtil/float128_test.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/__support/FPUtil/dyadic_float.h b/libc/src/__support/FPUtil/dyadic_float.h
index cce6b0c34..dfa5d15bc 100644
--- a/libc/src/__support/FPUtil/dyadic_float.h
+++ b/libc/src/__support/FPUtil/dyadic_float.h
@@ -472,7 +472,8 @@ template <size_t Bits> struct DyadicFloat {
       // exponents coming in to this function _shouldn't_ be that large). The
       // result should always end up as a positive size_t.
       size_t exp = -static_cast<size_t>(exponent);
-      size_t limit = static_cast<size_t>(cpp::numeric_limits<MantissaType>::digits);
+      size_t limit =
+          static_cast<size_t>(cpp::numeric_limits<MantissaType>::digits);
       size_t shift = neg_exp < limit ? exp : limit;
       new_mant >>= shift;
 

``````````

</details>


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


More information about the libc-commits mailing list