Hacker News new | past | comments | ask | show | jobs | submit login

You can't detect most UB at compile time. LLVM has a system to detect it a runtime. There is a significant performance penalty, but it can be useful during testing.

See https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html




It’s not actually that significant compared to something like asan. You can ship software with ubsan enabled if you want to.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: