(j3.2006) (SC22WG5.3829) Please tell me I'm wrong
Thu Dec 18 11:47:45 EST 2008
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?
More information about the J3