This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/23373] [4.0 only] Functions returning pointers with pointer argument
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Sep 2005 19:50:47 -0000
- Subject: [Bug fortran/23373] [4.0 only] Functions returning pointers with pointer argument
- References: <20050813091629.23373.tkoenig@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tkoenig at gcc dot gnu dot org 2005-09-18 19:50 -------
Not fixed in 4.0:
$ cat pointer_function.f90
program Realloc
IMPLICIT NONE
REAL, DIMENSION(:), POINTER :: x
INTEGER :: i
x => NULL()
x => myallocate(x)
contains
FUNCTION myallocate(p)
REAL, DIMENSION(:), POINTER :: p, myallocate
INTEGER :: nold,ierr
if (associated(p)) then
print *,"p is associated"
else
print *,"p is not associated"
end if
allocate(myallocate(20))
if (associated(p)) then
print *,"p is associated"
else
print *,"p is not associated"
end if
END FUNCTION myallocate
end program Realloc
$ gfortran pointer_function.f90
$ ./a.out
p is not associated
p is associated
$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0/configure --prefix=/home/ig25
--enable-languages=c,fortran
Thread model: posix
gcc version 4.0.2 20050917 (prerelease)
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Known to fail| |4.0.2
Known to work| |4.1.0
Resolution|FIXED |
Summary|Functions returning pointers|[4.0 only] Functions
|with pointer argument |returning pointers with
| |pointer argument
Target Milestone|--- |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23373