[Bug fortran/33116] New: External functions can be called as subroutine

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Aug 19 20:26:00 GMT 2007


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



More information about the Gcc-bugs mailing list