LibC: Remove strtold impossible assert

Removed the impossible assertion of sizeof(double) == sizeof(long
double) in strtold. This fixes the crash but suffers from lack of
precision.
Our eisel-lemire implementation on FloatingPointStringConversions needs
a big overhaul to work properly with long doubles, especially with x87
80-bit extended precision format.

Fixes #25791
This commit is contained in:
hiperbolt
2025-04-03 18:18:20 +01:00
committed by Nico Weber
parent 4f7ac757f6
commit b9e23f36cc

View File

@@ -579,7 +579,8 @@ double strtod(char const* str, char** endptr)
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtold.html
long double strtold(char const* str, char** endptr)
{
assert(sizeof(double) == sizeof(long double));
// FIXME: eisel-lemire needs a deep overhaul to work with fp80 and fp128.
// For now, we just implicitly cast to long double and accept the loss of precision.
return strtod(str, endptr);
}