Internal procedures as dummy arguments in gfortran?

Miguel Hermanns hermanns@tupi.dmt.upm.es
Wed Sep 23 09:48:00 GMT 2009


Hi Tobias,

thanks for the info.

Best regards,

Miguel

Tobias Burnus wrote:
> On 09/23/2009 10:05 AM, Miguel Hermanns wrote:
>> I know that internal procedures cannot be used as dummy arguments,
>> since it is forbidden in the fortran standard. I have also seen that
>> this prohibition has been introduced in gfortran through a patch by
>> Paul Thomas.
>> I'm wondering if there is any flag that allows to switch off that
>> restriction.
> 
> No, there is to my knowledge no switch to allow this; however, you have
> the source code and thus can disable the check and recompile.
> 
> As Fortran 2008 allows this, gfortran will eventually implement it.
> (Tracking bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34162 )
> 
> Note, however, that it is not trivial to support this in the general
> case as one needs to take care of how the variables are stored/accessed
> as stated in the following non-normative note in the Fortran 2003 standard:
> 
> "NOTE 12.16.   This standard does not allow internal procedures to be
> used as actual arguments, in part to simplify the problem of ensuring
> that internal procedures with recursive hosts access entities from the
> correct instance (12.5.2.3) of the host. If, as an extension, a
> processor allows internal procedures to be used as actual arguments, the
> correct instance in this case is the instance in which the procedure is
> supplied as an actual argument, even if the corresponding dummy argument
> is eventually invoked from a different instance."
> 
> Steve Lionel of Intel wrote in this regard: "The implementation is
> indeed not trivial and has to be different on each of the three
> operating systems we support, but it can be done."
> 
> Steve talks about three operating systems (Linux, Windows, MacOS on
> x86/x86-64/Itanium architecture), but GCC/gfortran runs on much more
> operating systems/hardware platforms ...
> 
> Thus it will take a while, even though I have the hope is that one can
> find a generic way of expressing it to the middle end. (Disclaimer: I
> have _not_ looked into the problem.)
> 
> Tobias
> 



More information about the Fortran mailing list