The following is invalid and rejected using -std=f2003, but I wonder whether one should not also reject it otherwise? What is the string length? function a(n,m) integer :: n,m character(n) a character(m) a end ifort and g95 reject it always. * * * If one wants to add only a check whether the variables are the same, one could use the same check for: function a(n,m) integer :: n,m character(n) a character(m) b entry b(n,m) end NAG f95 and ifort reject this with: - Incompatible character length for ENTRY B of function A - 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. gfortran currently (PR34421) accepts this for non-constant expressions.
Marking as dupe, discussion happened in PR37412. *** This bug has been marked as a duplicate of 37412 ***