This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33116] New: External functions can be called as subroutine
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Aug 2007 20:26:38 -0000
- Subject: [Bug fortran/33116] New: External functions can be called as subroutine
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
If one uses
EXTERNAL foo ! or PROCEDURE() :: foo
foo might be either function or a subroutine. However, using
REAL :: foo
EXTERNAL foo ! or: PROCEDURE(REAL) :: foo
foo is a function. However, gfortran happily allows the following:
EXTERNAL foo
REAL foo
CALL foo() ! <- wrong
NAG f95 diagnoses:
FOO has been declared as a function, not a subroutine
ifort:
The CALL statement is invoking a function subprogram as a subroutine.
g95:
Error: SUBROUTINE 'foo' at (1) cannot have REAL type
--
Summary: External functions can be called as subroutine
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33116