This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: FORTRAN 2003: Procedure Pointers doubts
On Wednesday 08 December 2004 12:17, Tobias Schlüter wrote:
> F2k3 wrote:
> > Hi,
> > I have few doubts regarding "Procedure pointers",
> > introduced in F2k3 standard.
> > I am explaining my doubts with a sample program below:
> >
> > ...
> >
> > It will be very nice of you, if somebody can rescue me
> > from my doubts !
>
> While this looks interesting, this is not the right forum to discuss is,
> comp.lang.fortran will be appropriate.
>
> This mailing list is about the development of gfortran, and sometimes its
> use.
Also note that this issue is not new, and already exists in f90. A limited
form of function pointers (dummy procedures) is already available.
The consensus seems to be that it is OK to pass a function with an explicit
interface as an actual argument for a dummy procedure with an implicit
interface. Obviously the normal restrictions apply, eg. functions returning
arrays or with assumed shape arguments must always be referenced via an
explicit interface.
I'd be very surprised (and disappointed) if the rules for f2003 function
pointers were different.
This does effect compiler design. Where functions must have an explicit
interface we can use special calling conversions. If a function can be called
through an implicit interface we have to be more careful.
Paul