3 ms·
finite-math-only is a footgun as well as it allows the compiler assume that NaNs do not exist. Which means all `isnan()` calls are just reduced to `false` so it
by Sharlin 3y ago
finite-math-only is a footgun as well as it allows the compiler assume that NaNs do not exist. Which means all `isnan()` calls are just reduced to `false` so it’s difficult to program defensively. And if a NaN in fact occurs it’s naturally a one-way ticket to UB land.
- klodolph 3y agoIf that’s a foot gun, then -Ofast is an autocannon. I like to think that the flag should be renamed “-Ofuck-my-shit-up”.
- MaulingMonkey 3y agoAs 1 of ∞ examples of UB land, I once had to debug JS objects being misinterpreted as numbers when https://duktape.org/ https://duktape.org/ was miscompiled with a fast-math equivalent (references to objects were encoded as NaNs.)