This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
gfortran question regarding dummy procedures
- From: Roger Ferrer IbÃÃez <rofirrim at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 23 Mar 2015 14:50:05 +0100
- Subject: gfortran question regarding dummy procedures
- Authentication-results: sourceware.org; auth=none
Hi,
in the following Fortran code
PROGRAM MAIN
EXTERNAL :: FOO
INTERFACE
SUBROUTINE S1(P1)
INTERFACE
FUNCTION P1(X)
INTEGER :: P1
INTEGER :: X1
END FUNCTION P1
END INTERFACE
END SUBROUTINE S1
SUBROUTINE S2(P2)
INTERFACE
FUNCTION P2(X)
REAL :: P2
REAL :: X
END FUNCTION P2
END INTERFACE
END SUBROUTINE S2
END INTERFACE
CALL S1(FOO) ! <-- why is this allowed?
CALL S2(FOO)
END PROGRAM MAIN
why is gfortran (tested with 4.9.1) allowing the call to S1? FOO has a
REAL implicit type so it looks to me that it cannot match the
characteristics of P1.
Am I wrong or this is a gfortran bug?
Kind regards,
--
Roger Ferrer IbÃÃez