[libc-commits] [libc] [libc] Fix build failure at with ASSUME_ROUND_NEAREST_ONLY (PR #207991)
via libc-commits
libc-commits at lists.llvm.org
Tue Jul 7 05:35:38 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Simon Tatham (statham-arm)
<details>
<summary>Changes</summary>
Commit 03c62ca40d19ba0 moved some local variables of `convert_float_hex_exp` into a struct called `properties`, but didn't edit the #ifdef branch for `LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY`, so builds with that definition failed.
---
Full diff: https://github.com/llvm/llvm-project/pull/207991.diff
1 Files Affected:
- (modified) libc/src/stdio/printf_core/float_hex_converter.h (+2-2)
``````````diff
diff --git a/libc/src/stdio/printf_core/float_hex_converter.h b/libc/src/stdio/printf_core/float_hex_converter.h
index efa01970c365f..e0cb3893ec9a3 100644
--- a/libc/src/stdio/printf_core/float_hex_converter.h
+++ b/libc/src/stdio/printf_core/float_hex_converter.h
@@ -115,9 +115,9 @@ LIBC_INLINE int convert_float_hex_exp(Writer<write_mode> *writer,
#ifdef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
// Round to nearest, if it's exactly halfway then round to even.
if (truncated_bits > halfway_const)
- ++mantissa;
+ ++properties.mantissa;
else if (truncated_bits == halfway_const)
- mantissa = mantissa + (mantissa & 1);
+ properties.mantissa = properties.mantissa + (properties.mantissa & 1);
#else
switch (fputil::quick_get_round()) {
case FE_TONEAREST:
``````````
</details>
https://github.com/llvm/llvm-project/pull/207991
More information about the libc-commits
mailing list