[libc-commits] [libc] [libc] Fix cast semantic in integer_to_string (PR #73804)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Wed Nov 29 07:26:35 PST 2023


https://github.com/gchatelet created https://github.com/llvm/llvm-project/pull/73804

None

>From bd3827b339034720d744e146ef42511b9cf29369 Mon Sep 17 00:00:00 2001
From: Guillaume Chatelet <gchatelet at google.com>
Date: Wed, 29 Nov 2023 15:25:28 +0000
Subject: [PATCH] [libc] Fix cast semantic in integer_to_string

---
 libc/src/__support/integer_to_string.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/src/__support/integer_to_string.h b/libc/src/__support/integer_to_string.h
index 6bbedac68efce2e..8d3859c8eb0ca5f 100644
--- a/libc/src/__support/integer_to_string.h
+++ b/libc/src/__support/integer_to_string.h
@@ -255,7 +255,7 @@ template <typename T, typename Fmt = radix::Dec> class IntegerToString {
       if constexpr (Fmt::BASE == 10) {
         write_unsigned_number(abs(value), sink);
       } else {
-        write_unsigned_number(cpp::bit_cast<UNSIGNED_T>(value), sink);
+        write_unsigned_number(static_cast<UNSIGNED_T>(value), sink);
       }
       // width
       while (sink.ok() && sink.size() < Fmt::MIN_DIGITS)



More information about the libc-commits mailing list