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

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Mon Dec 4 14:52:31 PST 2023


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

here, `idx` is a `int32_t`, so the cast only need be on `IDX_SIZE`

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


More information about the libc-commits mailing list