[libc-commits] [libc] [libc][NFC] fix int warnings in float conversion (PR #74379)

via libc-commits libc-commits at lists.llvm.org
Mon Dec 4 14:37:12 PST 2023


================
@@ -548,7 +550,8 @@ class FloatToString {
 
       val = POW10_SPLIT_2[p];
 #endif
-      const int32_t shift_amount = SHIFT_CONST + (-exponent - IDX_SIZE * idx);
+      const int32_t shift_amount =
+          static_cast<int32_t>(SHIFT_CONST + (-exponent - IDX_SIZE * idx));
----------------
michaelrj-google wrote:

I've rebased to pick that up, and also matched the narrower cast scope you had.

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


More information about the libc-commits mailing list