The following program should print 12 -14.0000000 but gfortran rejects it with Error: Contained function 'master.0.func' at (1) has no IMPLICIT type It fails with GCC 4.1.3, 4.2.1 and 4.3.0 with: end module m 1 Error: Contained function 'master.0.func' at (1) has no IMPLICIT type The same program compiles with NAG f95, g95, ifort. If one puts the procedure not into a module, it works. module m implicit none contains function func(a) integer :: a, func real :: ent func = a*4 return entry ent(a) ent = -a*2.0 return end function func end module m program main use m implicit none print *, func(3) print *, ent(7) end program main
Subject: Bug 34137 Author: burnus Date: Sun Nov 18 16:35:12 2007 New Revision: 130270 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130270 Log: 2007-11-18 Tobias Burnus <burnus@net-b.de> PR fortran/34137 * primary.c (match_variable): Reject non-result entry symbols. * resolve.c (resolve_contained_fntype): Do not check entry * master functions. 2007-11-18 Tobias Burnus <burnus@net-b.de> PR fortran/34137 * gfortran.dg/entry_14.f90: New. * gfortran.dg/entry_15.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/entry_14.f90 trunk/gcc/testsuite/gfortran.dg/entry_15.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/primary.c trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog
FIXED on the trunk (4.3.0). Was simpler than I thought.
Subject: Bug number PR34137 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00965.html