[libc-commits] [libc] [libc] Fix recently introduced integer-type warnings (PR #125864)

Lucas Duarte Prates via libc-commits libc-commits at lists.llvm.org
Wed Feb 5 07:53:23 PST 2025


================
@@ -604,7 +604,7 @@ approx_reciprocal(const DyadicFloat<Bits> &a) {
   // of correct bits in x' is double the number in x.
 
   // An initial approximation to the reciprocal
-  DyadicFloat<Bits> x(Sign::POS, -32 - a.exponent - Bits,
+  DyadicFloat<Bits> x(Sign::POS, -32 - a.exponent - int(Bits),
----------------
pratlucas wrote:

Is `Bits` guaranteed to fit in an int? It seems reasonable that it fits, but it's typed as `size_t` and I couldn't find any explicit checks for that in this file.

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


More information about the libc-commits mailing list