[Bug libstdc++/123078] std::from_chars handles signedness of zero in underflow inconsistently with floating-point literals
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Dec 10 11:50:43 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123078
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
e.g. if you change the code to:
constexpr char s[] = "-1e-1000";
float x = 99.0f;
const auto result = std::from_chars(s, std::end(s), x);
// x = -1e-1000;
std::cout << x;
Then it prints 99.
Or leave it uninitialized and enjoy a screenful of valgrind errors about the
uninitialised value.
More information about the Gcc-bugs
mailing list