https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104690
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Unlike C++ where ubsan does detect it because the language makes it easy to do so, I really don't see how ubsan could detect this. It requires that the callee tells the caller that it reached end of non-void function without return and the callee checks if the value is actually used there. That would effectively require an ABI change, so far -fsanitize=undefined is an opt-in instrumentation and allows free combination of callers built with sanitization vs. callers not built with those or vice versa. -fsanitize=undefined certainly doesn't claim to catch all kinds of undefined behavior, only those that it documents...