[J3] Question on Table 10.8: Intrinsic assignment type conformance
Bill Long
longb at cray.com
Fri Jun 14 12:23:19 EDT 2019
> On Jun 14, 2019, at 12:43 AM, Robert Corbett via J3 <j3 at mailman.j3-fortran.org> wrote:
>
> For the definition status of objects that have derived type, see 19.6.1 p4. Clearly, a scalar object of derived type that has no components is defined. The derived types shown in your example all have components.
True. But all of the only data component is default initialized. So, I’m thinking the warning message about not being defined is wrong. I’ll look into this more.
Cheers,
Bill
>
> Robert Corbett
>
>> On Jun 13, 2019, at 6:14 PM, Vipul Parekh via J3 <j3 at mailman.j3-fortran.org> wrote:
>>
>> On Thu, Jun 13, 2019 at 6:55 PM Steve Lionel via J3
>> <j3 at mailman.j3-fortran.org> wrote:
>>>
>>> ..
>>> Note the use of "declared type". The declared type of b and f() are both
>>> b_t, so this conforms.
>>>
>>
>> Thanks, Steve, for your input. I'd noticed that the use of "declared
>> type", I was wondering whether there was any additional interpretation
>> anywhere else in the standard that came into play with this
>> assignment. There isn't any such considerations, it appears.
>>
>>> As for the warning from the Cray compiler, it is correct. An ALLOCATE of
>>> a variable without SOURCE= does not define the variable. See 19.6.5.
>>> ..
>>
>> That's good to know. Again I was wondering if there was an item in
>> section 19.6.5 toward derived types with zero components that I had
>> failed to notice. Upon reading "Allocation of a zero-sized array or
>> zero-length character variable causes the array or variable to become
>> defined." and with *sequence types*, "When all components of a
>> structure of a numeric sequence type or character sequence type become
>> defined as a result of partially associated objects becoming defined,
>> the structure becomes defined," I became expectant of a consideration
>> somewhere in the standard regarding a variable of a derived type with
>> no components getting defined upon allocation. That would only be
>> common sense in my view. But it must not be that simple and
>> straightforward with derived types.
>>
>> Regards,
>> Vipul
>
Bill Long longb at cray.com
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
More information about the J3
mailing list