From: Richard Maine on
Paul van Delst <paul.vandelst(a)noaa.gov> wrote:

> Harald Anlauf wrote:

> > Warning: test_elementalslice.f90, line 26: INTENT(OUT) dummy argument
> > B partly default initialised but otherwise unused
> > detected at B_DESTROY@<end-of-statement>

> I do wonder why your warning messages say "partly" default initialised? I
> would hope it would be wholly default initialised.

I'll ignore the elided questions (as I also find it a slightly strange
message), but the "partly" mentioned above at least makes sense. I think
you are misreading the English of the message. It isn't that only part
of the default initialization is done. It is that only part of the type
has "default initialization". In particular, the component n is not
default initialized.

I find it slightly more amusing that the compiler seems to agree with a
viewpoint of mine that isn't reflected in the standard.

Per the standard, there is no default initialization in any of the
(elided) code unless my eyes are failing to see it.

I personally view allocatable components as being default initialized to
an unallocated status, based on the "waddles like a duck and quacks like
a duck" theory. That uninitialized status gets set in the same
situations where default initialization happens. I wish the standard
would just call it default initialization, since that's what it acts
like. More substantitively, I wish that the user was allowed to confirm
the default initialization by explicit declaration, which could help
clarity. As is, it is a bit like an implicit default initialization that
you can't make explicit.

Sounds to me like the NAG compiler must be viewing it the sam eway as I
do. Otherwise, I don't see what default initialization has to do with
the code shown.

--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain