Hacker News new | ask | show | jobs
by jacobparker 4892 days ago
In theory, for sure. Valgrind can test for certain kinds of undefined behaviour - it runs the code in a special virtual machine.

You could also have the compiler insert checks. Obviously this isn't desirable for a lot of C projects by default, but (other than in places like kernel development etc.) it could be a nice debugging aid. I don't know of any good tools for doing this comprehensively.