by rcfox · 11y ago · 0 comments
If you are using gcc, you can start with the flag: -ftrapv. It does everything for you.
I guess the best solution is to move to other languages (IIRC Ada and rust are relatively free from surprises in their UB) and let language lawyers optimize C to death (by attrition).
If it helps: The author of that article, John Regehr, is a professor of computer science who spends a great deal of time studying undefined behaviour.
-Strawman argument.
-Appeal to authority.
Next time stick to the issue, you will find the debate will be much more rewarding for both parties.