4 ms·
Crazy how often this catches undefined behavior. Compiling GLFW with Zig we've found like ~4 separate UB issues, one I described here[0] Wish it could default
by slimsag 5y ago
Crazy how often this catches undefined behavior. Compiling GLFW with Zig we've found like ~4 separate UB issues, one I described here[0]
Wish it could default to on with clang, but probably it'd break too many things. Really wonder how many severe issues we'd find just from turning this on by default everywhere, though.
[0] https://devlog.hexops.com/2021/perfecting-glfw-for-zig-and-finding-undefined-behavior https://devlog.hexops.com/2021/perfecting-glfw-for-zig-and-f...
- bregma 5y agoUBSAN adds a lot of runtime overhead. Turning it on my default would mean most software built with clang (or GCC, which has also had it for years) would suddenly be dog slow, like MSVCC in debug mode. Few developers have any idea how to use their toolchain correctly, so the defaults need to be chosen wisely.
- a_e_k 5y agoI recently started testing a project with -fsanitize=integer as well. It'll report a few potential issues that -fsanitize=undefined won't, like left shifting a 1-bit off the end.