https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64459
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- GCC5 supports in -fsanitize=undefined runtime warning or error when returns_nonnull function does return NULL, so in theory it should be able to tell you without such script.