This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Procedure Pointers: a first patch
Janus Weil wrote:
(Also I'm seeing a couple of regressions right now, which I will have
to look into ...)
All three of these result from the same problem: external
pointer-valued functions!
The answer is easy (it too me only half an hour to find it ;-):
Fortran 95 has:
Constraint: If the POINTER attribute is specified, the TARGET, INTENT,
EXTERNAL, or
INTRINSIC attribute shall not be specified.
gfortran actually missed a check for this contrain, well too late.
And Fortran 2003 has:
"C512 (R501) If the POINTER attribute is specified, the ALLOCATABLE,
TARGET, or INTRINSIC attribute shall not be specified."
(if you read there EXTERNAL, you did not look at the second corrigendum,
available at http://gcc.gnu.org/wiki/GFortranStandards)
And a bit later one finds:
"A procedure that has both the EXTERNAL and POINTER attributes is a
procedure pointer."
Thus, as written, the answer is easy.
I tested with several compilers; the result is:
Accepted: gfortran
Rejected: NAG f95, g95, openf95, ifort, sunf95
Not supported: g77
However, I do not see why (a) f2c_6.f90, (b) value_4.f90, and (c)
gfortran.fortran-torture/execute/entry_7.f90
fail. There is not a single occurrence of EXTERNAL.
Tobias