by aciuix · 11y ago · 0 comments
C is not a scripting language. If you use the tools available to you, and don't abuse the language, then it is fairly hard to cause undefined behavior.
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.