mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 17:26:51 +08:00
Fix failing test builds with -Werror=maybe-uninitialized on gcc
Apparently the added constexpr makes gcc's control flow analysis to go deeper. If from_chars returns with error then the out parameter remains uninitialized. As it's undefined behavior to use its value, it's better to just skip the rest of the loop in this case.
This commit is contained in:
parent
e4d4e43b21
commit
58798ee81f
@ -62,6 +62,7 @@ void random_values(size_t N) {
|
||||
if (errors > 10) {
|
||||
abort();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (std::isnan(v)) {
|
||||
if (!std::isnan(result_value)) {
|
||||
|
||||
@ -65,6 +65,7 @@ void random_values(size_t N) {
|
||||
if (errors > 10) {
|
||||
abort();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (std::isnan(v)) {
|
||||
if (!std::isnan(result_value)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user