-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLANG_X] use of infinity is undefined behavior due to the currently enabled floating-point options #45181
Comments
assign core |
New categories assigned: core @Dr15Jones,@makortel,@smuzaffar you have been requested to review this Pull request/Issue and eventually sign? Thanks |
cms-bot internal usage |
A new Issue was created by @iarspider. @smuzaffar, @rappoccio, @sextonkennedy, @Dr15Jones, @antoniovilela, @makortel can you please review it and eventually sign/assign? Thanks. cms-bot commands are listed here |
I meant we need to use edm::isFinite etc to check for infinity/nan in presence of -ffast-math (although one could also ask if such code relying on IEEE infinity behavior should really be compiled with -ffast-math...). This warning (and the similar static analyzer check) are very useful to catch the problems. |
Just use |
+core |
This issue is fully signed and ready to be closed. |
Splitting off from cms-sw/cmsdist#9200 for visibility
In CLANG_X IBs, a lot of
Wnan-infinity-disabled
warnings are generated, e.g.We are building cmssw with
-ffast-math
, which sets (among other flags)-ffinite-math-only
, allowing compiler to assume all floating-point numbers will be finite (no NaNs or infinities), but some functions explicitly returnstd::numeric_limits<float>::infinity
andstd::numeric_limits<float>::quiet_NaN
.If I'm reading @makortel's comment right, we check for NaN/infinity ourselves (instead of relying on compiler to do it), so this warning can be disabled.
The text was updated successfully, but these errors were encountered: