zlacker

[parent] [thread] 2 comments
1. Sharli+(OP)[view] [source] 2024-01-16 15:43:57
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.
replies(2): >>klodol+E5 >>Maulin+Va1
2. klodol+E5[view] [source] 2024-01-16 16:07:28
>>Sharli+(OP)
If that’s a foot gun, then -Ofast is an autocannon.

I like to think that the flag should be renamed “-Ofuck-my-shit-up”.

3. Maulin+Va1[view] [source] 2024-01-16 21:03:16
>>Sharli+(OP)
As 1 of ∞ examples of UB land, I once had to debug JS objects being misinterpreted as numbers when https://duktape.org/ was miscompiled with a fast-math equivalent (references to objects were encoded as NaNs.)
[go to top]