Open CaseyCarter opened 2 weeks ago
I don't know what you would do about it other than suppression.
/fp:fast
is indeed asking for UB for NANs.
I don't know what you would do about it other than suppression.
/fp:fast
is indeed asking for UB for NANs.
Ideally, we don't test undefined behavior. It tends to be unreliable. That could mean adding a macro to the /fp:fast
configs that tells the tests to avoid problematic code. Or it could mean suppression, or it could mean not running those tests with /fp:fast
.
I see.
The whole point of separating VSO_0000000_vector_algorithms_floats
from VSO_0000000_vector_algorithms
was testing the cursed floating modes with the same exhaustive coverage as the standard /fp:precise
mode.
Out of the cursed modes, /fp:fast
is the main goal for testing, as it changes the control flow for the algorithm in question.
We can possibly drop infinities from /fp:fast
coverage, that is, remove these elements:
https://github.com/microsoft/STL/blob/c7c5ca7d6adde7c1554b1e52c0b97cb2a7f7ca60/tests/std/tests/VSO_0000000_vector_algorithms_floats/test.cpp#L33-L34
As for NANs. the test doesn't even try them in the standard /fp:precise
mode. We've concluded that we don't support NANs in the sorting algorithms.
But most of these warnings (actually all quoted in the description) originate from <cmath>
and <limits>
headers.
Need to suppress them in these headers!
After one minute of my not-especially-clueful attempting during the weekly maintainer meeting, we weren't able to repro warnings from <limits>
with a from-scratch source file. We should extract a minimal repro to understand exactly what about this test is continuing to emit Clang warnings. As usual, if merely including the header and doing not-risky things (like mentioning numeric_limits<double>::stuff()
but not specifically inf/nan directly) emits a warning, then we should suppress it in the STL headers, but not if the user is asking us to do risky things on their behalf.
All 8
clang-cl /fp:fast
configs have the same issue. For example:Error log for
clang-cl /fp:fast /MT
without/D_USE_STD_VECTOR_ALGORITHMS=0
4932 will silence these warnings for the time being.