Re:The Curious Case of the Longevity of C
by jchb on Tuesday October 03, 2017 @10:56AM
(#15392809)
It exists. Clang has UBSan which can detect many undefined behaviour (https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#...).
It's integrated into Apple's Xcode 9, which can pause into the debugger when encountering an issue.
I was actually using it to debug an issue just as I read your comment.
[ Parent
| on HN ]
Re:The Curious Case of the Longevity of C
by iainmerrick on Tuesday October 03, 2017 @11:55AM
(#15393290)
It exists, but it doesn't do anything in the example that was discussed recently, "undefined behavior may call a never-called function": https://news.ycombinator.com/item?id=15324414
As far as I can tell, -O0 is the only way to avoid that particular mis-optimization in Clang.