[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 16:04:33 PST 2023


================
@@ -864,7 +867,7 @@ LIBC_INLINE int convert_float_dec_auto_typed(Writer *writer,
              (cur_last_digit == 9 || cur_last_digit == 0)) {
         // If the next digit is not the same as the previous one, then there are
         // no more contiguous trailing digits.
-        if ((copy_of_digits % 10) != cur_last_digit) {
+        if (static_cast<int>(copy_of_digits % 10) != cur_last_digit) {
----------------
michaelrj-google wrote:

I think you mean `cur_last_digit` should be unsigned, which I agree with.

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


More information about the libc-commits mailing list