This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Compiler error with local procedure pointers of same name
- From: John McFarland <john dot mcfarland at swri dot org>
- To: fortran at gcc dot gnu dot org
- Date: Tue, 29 Jun 2010 10:24:11 -0500
- Subject: Compiler error with local procedure pointers of same name
gfortran errors out on the code below, which I believe is valid. It
appears to confuse two different local procedure pointers that have the
same name for a global procedure pointer that is used inconsistently as
both a function and a subroutine.
-- John
MODULE m
IMPLICIT NONE
CONTAINS
FUNCTION func(x) RESULT(y)
INTEGER :: x,y
y = x *2
END FUNCTION func
SUBROUTINE sub(x)
INTEGER :: x
PRINT*, x
END SUBROUTINE sub
SUBROUTINE use_func()
PROCEDURE(func), POINTER :: f
INTEGER :: y
f => func
y = f(2)
END SUBROUTINE use_func
SUBROUTINE use_sub()
PROCEDURE(sub), POINTER :: f
f => sub
CALL f(2)
END SUBROUTINE use_sub
END MODULE m