[Bug c/96550] gcc is smart in figuring out a non-returning function.

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 10 11:33:07 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96550

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If FAIL is defined, your myfunc will always trigger undefined behavior if
called, and as such anything can happen.
Derefencing NULL is UB.
If you are on an embedded system where there is memory mapped, you can use
-fno-delete-null-pointer-checks (for some embedded targets it is even the
default).


More information about the Gcc-bugs mailing list