3 ms·
gcc 4.9 has a new UndefinedBehaviorSanitizer, -fsanitize=undefined - http://gcc.gnu.org/gcc-4.9/changes.html http://gcc.gnu.org/gcc-4.9/changes.html Perhaps th
by joosters 13y ago
gcc 4.9 has a new UndefinedBehaviorSanitizer, -fsanitize=undefined - http://gcc.gnu.org/gcc-4.9/changes.html http://gcc.gnu.org/gcc-4.9/changes.html
Perhaps this will help find these coding mistakes? (unfortunately, it seems to be a runtime checker and not a compile-time warning)
- DanWaterworth 13y agoAs others have pointed out, statically determining whether a program will invoke undefined behaviour is undecidable.
- joosters 13y agoAh, but it doesn't have to be exact to be useful. Spotting common cases and minimising false positives would be great, even if there was no guarantee of catching everything.
- Groxx 13y agoThat's like saying the halting problem is undecidable. Just because we can't make a general-case solution doesn't mean there isn't progress to be made.