This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Functions returning pointers
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: fortran at gcc dot gnu dot org,"gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 23 Aug 2004 13:11:09 +0200
- Subject: Re: Functions returning pointers
- References: <4128FF9E.7070600@physik.uni-muenchen.de> <200408222144.45547.paul@codesourcery.com> <41291AA1.4030904@physik.uni-muenchen.de> <200408222347.12014.paul@codesourcery.com>
Paul Brook wrote:
>>Fix below, as you suggested off-list.
>
>
> You should know better than to believe what I tell you ;-)
OK, you're no longer my infallible Guru! :-)
> This condition should be
> if (sym->attr.pointer && !(se->want_pointer || byref))
>
> Incomplete testcase:
> program assignment_2
> character, target :: t
> character, pointer :: p
>
> p = f()
> contains
> function f()
> character, pointer :: f
> f => t
> end function
> end program
>
Unfortunately, it doesn't work this way. Nothing from the tree dumps strikes
me as an obvious mistake right now, but I'll see if I can find out what goes
wrong.
> It also makes sense to test the warning.
Agreed.
- Tobi