[libc-commits] [libc] [libc][NFC] Clean up conversion warnings in math function implementations. (PR #74697)

via libc-commits libc-commits at lists.llvm.org
Thu Dec 7 08:41:56 PST 2023


================
@@ -769,7 +769,7 @@ LLVM_LIBC_FUNCTION(double, log, (double x)) {
   // Range reduction for log(x_m):
   // For each x_m, we would like to find r such that:
   //   -2^-8 <= r * x_m - 1 < 2^-7
-  int shifted = x_u >> 45;
+  int shifted = static_cast<int>(x_u >> 45);
----------------
lntue wrote:

It was to remove the warning of implicit conversion from `uint32_t` to `int`, by making it explicit.

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


More information about the libc-commits mailing list