[Bug fortran/126530] Option -Wundefined-vars doesn't catch functions returning without defining their result

mikael at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 31 08:44:07 GMT 2026


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

--- Comment #2 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Mikael Morin from comment #0)
>   function k1()
>     integer, pointer :: k1
>     allocate(k1)
>   end function
>   function k2() result(r)
>     integer, pointer :: r
>     allocate(r)
>   end function

Actually, maybe these two can be dropped.
It would be fine for a user to define its own allocation function that would
return a pointer without defining the value.


More information about the Gcc-bugs mailing list