This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: TR15581 - elemental assignment of structures with alloctable components



On Jul 5, 2006, at 9:53 AM, Brooks Moses wrote:


Paul Thomas wrote:
The iso_varying_string testsuite now mostly works, except for vst_2.f95 and three others that have IO problems. vst_2.f95 fails on elemental assignment of arrays of structures with allocatable components....

I think this falls under a category of situations that Richard Maine was talking about on comp.lang.fortran recently -- specifically, that the standard expects that allocatable arrays will work exactly as non-allocatable arrays do, except in places where they are explicitly different. (Specifically, they are not assumed to act like pointers!)...


(i) A copy of the structure is made, and any allocatable components are storage-associated with the corresponding allocatable components of the original, whereas the non-allocatable components are not storage-associated.
(ii) A copy of the structure is made, and none of the components of the copy are storage-associated with the components of the original.


My opinion is that, when it's looked at that way, the first option is pretty clearly wrong. Unless one makes assumptions about implementation (which is contrary to the spirit of the Fortran standards), the part about allocatable components being storage- associated on copy just comes out of left field, and makes no sense.

For what it is worth, I agree with Brooks, and I also think that was a good job of explanation. I could dig up the citations, but it doesn't really seem necessary, as choice 1 is so "obviously" wrong that if the standard actually said that I'd be inclined to submit a "bug report" (aka interpretation request) on the standard.


--
Richard Maine                |  Good judgment comes from experience;
Richard.Maine@nasa.gov       |  experience comes from bad judgment.
                            |        -- Mark Twain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]