(j3.2006) (SC22WG5.4379) [ukfortran] WG5 informal ballot re Interop. TR

Bill Long longb
Mon Dec 6 13:24:13 EST 2010



On 12/6/10 11:21 AM, Aleksandar Donev wrote:
> On 12/06/10 11:20, Bill Long wrote:
>> However, if it is a C function calling Fortran with such an interface,
>> reconstructing all of the CLASS infrastructure on the Fortran side
>> from the information in the C descriptor might be problematic.
> Those are not interoperable, so there is no way for C to call such a
> Fortran function, nor do we want that. The issue here is only whether

I'm not sure what you mean by "those". We are defining interoperability 
of interfaces (not variables) here.  If the interface is interoperable, 
it works both ways. Fortran calls C and C calls Fortran.  In fact, the 
"C" side does not even have to be written in C.  This is a fundamental 
feature of interoperability, spelled out in the first paragraph of 
Clause 15.

> Fortran can pass a CLASS(*) object to C via a descriptor. It seems

If we make that the case, then we have to also allow a C function to 
call a BIND(C) Fortran subprogram that has a CLASS(*) dummy.  Note that 
CLASS(*) and TYPE(*) are very different in this respect. A Fortran 
subprogram can do almost nothing with a TYPE(*) dummy argument, so the 
information contained in the C descriptor is more than adequate.  A 
Fortran subprogram can do a lot more with a CLASS(*) dummy.

Cheers,
Bill


> Malcolm and Reinhold suggest yes, and I agree. I think Craig does too
> (or he should listen to me anyway :-).
> Best,
> Aleks
>

-- 
Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101





More information about the J3 mailing list