The following invalid code shows that a certain invalid code is not diagnized:
function f1() character(1) :: f1 character(:), allocatable :: g1 f1 = 'f' return entry g1() g1 = 'g' end function f2() character(1) :: f2 character(1), allocatable :: g2 f2 = 'f' return entry g2() g2 = 'g' end function f3() character(1) :: f3 character(1), pointer :: g3 f3 = 'f' return entry g3() g3 = 'g' end
% ifort ifort-entry-mismatch.f90 ifort-entry-mismatch.f90(6): error #6625: The character lengths of the functions must not be different. [G1] entry g1() ------^ ifort-entry-mismatch.f90(24): error #7127: The characteristics of the function named on the ENTRY statement are different from the characteristics of the result of the function named on the FUNCTION statement. [G3] entry g3() ------^ compilation aborted for ifort-entry-mismatch.f90 (code 1)
Case 2 with function f2/entry g2 should be rejected, too, according to F2018, 18.104.22.168
ENTRY statement, paragraph 3. The characteristics do not match, as in the last case of the example.