Aleksandar Donev said:
> I just found a big bug in a code after trying a different compiler: I
> had assumed that a local procedure variable of derived type would be
> automatic and reset (default initialized) upon entry to the procedure.
It certainly is (unless, or course, it has the SAVE attribute).
> Upon trying to fix this I realized it is not easy to default initialize
> such a local variable in Fortran 95 (presumably in Fortran 2003 I would
Huh?
See Fortran 95 standard [289:43-47]
"(19) Invocation of a procedure that contains a nonsaved local object that
is not a dummy argument, is not accessed by use or host association,
has neither the ALLOCATABLE nor POINTER attribute, and is of a derived
type in which default initialization is specified for any direct
components, causes those components of the object to become defined."
If you're talking about something else, i.e. not a local variable at all,
perhaps you could explain? Or perhaps you've found a bug in someone's
compiler, in which case you should inform them....
Cheers,
--
...........................Malcolm Cohen, Nihon NAG, Tokyo, Japan.
([log in to unmask])
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
|