[libc-commits] [libc] 863be13 - [libc] Fix build failure with ASSUME_ROUND_NEAREST_ONLY (#207991)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 7 08:05:44 PDT 2026


Author: Simon Tatham
Date: 2026-07-07T16:05:39+01:00
New Revision: 863be135eb5261fc85007492a5f26de926802a81

URL: https://github.com/llvm/llvm-project/commit/863be135eb5261fc85007492a5f26de926802a81
DIFF: https://github.com/llvm/llvm-project/commit/863be135eb5261fc85007492a5f26de926802a81.diff

LOG: [libc] Fix build failure with ASSUME_ROUND_NEAREST_ONLY (#207991)

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.

Added: 
    

Modified: 
    libc/src/stdio/printf_core/float_hex_converter.h

Removed: 
    


################################################################################
diff  --git a/libc/src/stdio/printf_core/float_hex_converter.h b/libc/src/stdio/printf_core/float_hex_converter.h
index f97c06f9dafbd..6ac3bfac8a76e 100644
--- a/libc/src/stdio/printf_core/float_hex_converter.h
+++ b/libc/src/stdio/printf_core/float_hex_converter.h
@@ -137,9 +137,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:


        


More information about the libc-commits mailing list