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

via libc-commits libc-commits at lists.llvm.org
Wed Nov 29 07:40:31 PST 2023


Author: Guillaume Chatelet
Date: 2023-11-29T16:40:25+01:00
New Revision: 7eb3103123ffa5c6061ad6775ba6c87d6cd5e256

URL: https://github.com/llvm/llvm-project/commit/7eb3103123ffa5c6061ad6775ba6c87d6cd5e256
DIFF: https://github.com/llvm/llvm-project/commit/7eb3103123ffa5c6061ad6775ba6c87d6cd5e256.diff

LOG: [libc] Fix cast semantic in integer_to_string (#73804)

Added: 
    

Modified: 
    libc/src/__support/integer_to_string.h

Removed: 
    


################################################################################
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