[J3] Question to "The CFI_section function"

Robert Corbett rpcorbett at att.net
Tue Nov 12 11:57:33 EST 2019



Sent from my iPhone

> On Nov 12, 2019, at 7:11 AM, Steve Lionel via J3 <j3 at mailman.j3-fortran.org> wrote:
> 
>> On 11/12/2019 7:24 AM, Tobias Burnus via J3 wrote:
>> Follow-up question: what are the 'lower_bound's after a call to CFI_establish (18.5.5.5)?
>> 
>> For allocatables, the input is a null pointer/deallocated. And for pointers, there is "if the attribute argument has the value CFI_attribute_pointer, the lower bounds of the object described by dv are set to zero."
>> 
>> But what's about CFI_attribute_other? Shall they also start at 0 – like most descriptors on the C side? Or at 1 as they would in Fortran or …? The following sentence "The remaining properties of the object are given by the other arguments." does not really help.
> 
> In the C descriptor world, arrays start at zero as they do in C. The only way they can become non-zero is through argument association, allocation or pointer association as specified in 18.5.3p3. For non-pointer, not-allocatable objects (this means "other"), the lower bounds are supposed to be always zero. I'm not seeing a problem with the wording in that paragraph, though like a lot of the standard, your mind has to fill in blanks from elsewhere in the text.

Oops!  I see that I was misreading
the description in 18.5.5.7.  I now
see that it is describing the parts
of the array addressed by source
that form the value of section.
The lower bounds of the descriptor
addressed by result do remain zero.

Bob Corbett


More information about the J3 mailing list