This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33117] New: Improve error message for generic interface with subroutines & functions
- 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 21:02:47 -0000
- Subject: [Bug fortran/33117] New: Improve error message for generic interface with subroutines & functions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Mixing functions and subroutines in a generic interface is invalid. gfortran
detects this but the error message is difficult to understand:
Error: FUNCTION at (1) does not belong in a generic subroutine interface
NAG f95:
Error: b.f90, line 10: BAR and SUB must both be SUBROUTINEs or both be
FUNCTIONs for generic GEN
g95:
Error: Interfaces of generic 'gen' at (1) must all be FUNCTIONs or SUBROUTINEs
ifort -stand f95:
fortcom: Warning: b.f90, line 6: Standard Fortran requires that within a
scoping unit, two procedures that have the same generic name shall both be
subroutines or both be functions. [BAR]
Example:
module mod
implicit none
interface gen
subroutine sub()
end subroutine sub
function bar()
real :: bar
end function bar
end interface gen
end module mod
--
Summary: Improve error message for generic interface with
subroutines & functions
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: diagnostic
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=33117