4 ms·
Yes, I agree. In my opinion, using -wrapv to handle signed overflow is a great mistake. The right compiler option is "-fsanitize=undefined -fsanitize-undefine
by adrian_b 4y ago
Yes, I agree.
In my opinion, using -wrapv to handle signed overflow is a great mistake.
The right compiler option is "-fsanitize=undefined -fsanitize-undefined-trap-on-error".
There is no need to implement any code to handle signed overflow, all decent compilers have appropriate options, which unfortunately are not the default, because too many people prefer speed over correctness.