Closed digimokan closed 7 months ago
The issue is that fpclassify
& signbit
are not available for C++98 or C++03, which the ETL still maintains compatibility with.
I may have to disable the warning for those lines or use !(v < 0) && !(v > 0)
.
Ok, I didn't realize that. I'm not sure how to replace signbit
portably.
I think the test !(v < 0) && !(v > 0)
should be enough, as the effective check is "For any variant of zero, make it positive zero".
Fixed 20.38.7
In hash.h, when compiling with -Wfloat-equal, the "v == -0.0f" on line 401 (and similar on lines 435 and 469) produce "warning: comparing floating-point with '==' or '!=' is unsafe."
Using
fpclassify
andFP_ZERO
to fix this issue would work, but I think these are not portable. It looks likesignbit
is portable (assuming you can usemath.h
orcmath
?), so maybe something withsignbit
and '>' or '<' comparisons would work?