[J3] Question to "The CFI_section function"

Bill Long longb at cray.com
Tue Nov 12 17:16:25 EST 2019


> On Nov 12, 2019, at 9: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.


Right.  The “other” category is usually for the C equivalent of an explicit-shape array.  The method for declaring an array in C involves specifying the extents for each dimension and not bounds.  The lower bounds are implicitly 0.   Thus, the construction of a descriptor for such an array involves passing the extents, and not bounds. 

Cheers,
Bill



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

Bill Long                                                                       longb at cray.com
Principal Engineer, Fortran Technical Support &   voice:  651-605-9024
Bioinformatics Software Development                      fax:  651-605-9143
Cray, a Hewlett Packard Enterprise company/ 2131 Lindau Lane/  Suite 1000/  Bloomington, MN  55425





More information about the J3 mailing list