3 ms·
Why not just define these things? Make -fwrapv, -fno-strict-aliasing the standard?
by twtw 8y ago
Why not just define these things? Make -fwrapv, -fno-strict-aliasing the standard?
- gpderetta 8y agoBecause many (most?) Don't want them.
- garaetjjte 8y agoBecause it prevents some optimizations, eg. there is one reason for signed overflow UB: https://gist.github.com/rygorous/e0f055bfb74e3d5f0af20690759de5a7 https://gist.github.com/rygorous/e0f055bfb74e3d5f0af20690759...
- vinkelhake 8y agoOne argument (that is unrelated to optimization) for keeping signed wrap undefined is that most instances of it is a real bug. By keep signed wrap undefined, you now have the option of using -ftrapv to weed out such bugs.
- jforberg 8y agoThat might be a valid argument for making -ftrapv the standard. It's certainly not an argument for keeping it undefined. Most -f options tweak the standard in some way and defining overflow would not make -ftrapv suddenly go away.