[J3] Question to "The CFI_section function"

Steve Lionel steve at stevelionel.com
Tue Nov 12 10:11:06 EST 2019


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.

>
> PS: Are there already some (draft) corrigenda for Fortran 2018? I 
> haven't seen any, but I might have missed them.
Not yet.




More information about the J3 mailing list