(j3.2006) (SC22WG5.3829) Please tell me I'm wrong
Robert Corbett
Robert.Corbett at Sun.COM
Fri Dec 19 04:04:03 EST 2008
Andy Vaught wrote:
> On Wed, 17 Dec 2008, Robert Corbett wrote:
>
>
>>I have given some consideration to the final point. The restriction
>>that C_LOC cannot be applied to an array that is not contiguous seems
>>to be unnecessary for most types on most architectures. I am not sure
>>if it csn work for arrays of type CHARACTER on machines where the
>>smallest addressable unit is larger than a byte, but other than that,
>>I see no need for the restriction.
>>
>>If C_LOC is extended to allow actual arguments that are not contiguous,
>>one further extension is needed to make it useful, namely, a way to
>>access the strides. The intrinsic function SHAPE provides an array of
>>the extents of the array. A function, say C_STRIDE, could provide an
>>array of strides.
>>
>>Given those two extensions, a C function could be written to access the
>>elements of an assumed-shape or deferred-shape array. The form of the
>>prototype for the function might be
>>
>> foo(int rank, void* address, size_t extent[restrict],
>> ptrdiff_t stride[restrict], ...)
>>
>
>
> Wouldn't you get the same thing from the TR for portable C access to
> fortran array descriptors?
Yes, the TR give me all the information that is in the
descriptors and more.
Bob Corbett
More information about the J3
mailing list