Skip to content

Commit 2dd296a

Browse files
[libc] Fix implicit conversion error on rv32 (#138622)
This patch fixes the following error on rv32 (and possibly other 32-bit archs): FPBits.h:760:40: error: implicit conversion loses integer precision: 'int' to 'size_t' (aka 'unsigned int') [-Werror,-Wimplicit-int-conversion] 760 | result.set_significand(number >> -ep); Fixes #138425.
1 parent e356893 commit 2dd296a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc/src/__support/FPUtil/FPBits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ struct FPRepImpl : public FPRepSem<fp_type, RetT> {
757757
result.set_significand(number);
758758
result.set_biased_exponent(static_cast<StorageType>(ep + 1));
759759
} else {
760-
result.set_significand(number >> -ep);
760+
result.set_significand(number >> static_cast<unsigned>(-ep));
761761
}
762762
return RetT(result.uintval());
763763
}

0 commit comments

Comments
 (0)