[Patch, fortran] PR51976 - [F2003] Support deferred-length character components of derived types (allocatable string length)

Janus Weil janus@gcc.gnu.org
Sun Mar 9 19:28:00 GMT 2014


Hi,

> The need to add a deallocate, indicates that the automatic clean-up is
> not ocurring for these variables.

yes, but in fact that is not a bug but a feature. The Fortran standard
does not demand auto-deallocation and finalization of variables in the
main program (but it should be done e.g. inside a subroutine).

See also PR 55207 (which reminds me that I still have a patch pending
for this one).

Cheers,
Janus



> On 9 March 2014 19:48, Walter Spector <w6ws@earthlink.net> wrote:
>> Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
>>> ...
>>>     deallocate(string)  ! Fix valgrind
>>
>> I would agree in the case where 'string' had the pointer attribute.  But with allocatables, valgrind should be seeing the memory block as 'still reachable'.
>>
>> Walter
>
>
>
> --
> The knack of flying is learning how to throw yourself at the ground and miss.
>        --Hitchhikers Guide to the Galaxy



More information about the Fortran mailing list