(j3.2006) (SC22WG5.3591) Assumed-type and Assumed-rank extensions for C Interop TR.

Aleksandar Donev donev1
Fri Jul 25 14:40:33 EDT 2008


On Friday 25 July 2008 11:31, Jim Xia wrote:

> If the procedure is defined in Fortran for C, then how can a Fortran
> programmer "map" this dummy argument to real Fortran data type. 
Didn't Bill just show a way. Not the best way maybe, but it is a way?

> This is 
> similar to CLASS(*) case, in which we have select type construct
The difference is that SELECT TYPE is a "safe" type cast, in that it only 
casts if the cast is right, since it examines the type descriptor and then 
chooses the correct case.

Except, we do allow an *unsafe* pointer assignment in one case:
"If data-pointer-object is polymorphic, it assumes the dynamic type of 
data-target. If data-pointer-object is of a
type with the BIND attribute or the SEQUENCE attribute, the dynamic type of 
data-target shall be that type."

Allowing

integer_array => typeless_array

would be in that category, which may be OK or may be objected to? The reverse 
should be allowed, without having to go through C_LOC or some such hoops, 
IMO.

Aleks




More information about the J3 mailing list