(j3.2006) 5.4.7p2 goes a little bit too far

Malcolm Cohen malcolm
Tue Jul 23 05:09:25 EDT 2013

>> >  A question Tobias didn't ask was whether
>> >we intended to prohibit this:
>> >
>> >  type(t) :: B(3)
>> >  data B(2) / t(2,39.0) /
>> >
>> >which doesn't impose the burden contemplated by F08/0062.
>> Well it does impose essentially the same burden, and does violate the first
>> sentence of the explanation.
>The second sentence of the explanation is "It was considered to be a
>burden on processors to be required to initialize some parts of a
>structure using default initialization, and other parts of it

Which is true as far as it goes, which is as far as the question asked.

As for your attempts to over-interpret the words of F08/0062 to override the 
standard, I say again

   "F08/0062 is not normative text"

It is not written as normative text.  It is written as a "helpful explanation" 
to Tobias to explain *why* we have some prohibitions.  The helpful explanation 
is not standardese, not legally binding in any way, and does not replace any 
text in the standard.

Please don't try to make us reduce helpful explanations to "No.  RTFS.".

>> One might conjecture that asking this question with an array element would 
>> get
>> precisely the same response as asking with a component: it is not conforming 
>> and
>> we did it deliberately, to reduce the burden on the processor.
>F08/0062 seems pretty obviously to me to be saying that "parts of a
>structure" in 5.4.7p2 was aimed at structures, not arrays.

The words "parts of a structure" do not appear anywhere in 5.4.7p2, which reads, 
in its entirety
  "If a nonpointer object has default initialization, it shall not appear in a 

And you are ignoring the first sentence of the explanation entirely.  As well as 
the bit about it being a burden to processors, which would apply equally to 
arrays as to scalars.

As a helpful explanation it explains WHY the prohibition is there in the case 
asked about (structure components), and the rationale clearly would also explain 
WHY the prohibition is there in the case not asked about (array elements).

>There is no problem with
>  real :: A(10)
>  data a(5) / 42.0 /
>This flies in the face of the first sentence of F08/0062: "The intention
>was that an object be initialized entirely in a type declaration

Not so: we are talking about default initialisation, and in that context "REAL 
A(10)" is not under consideration.  This is perfectly clear, especially if you 
quote the whole sentence instead of only part of it.

>So which was it in F08/0062: components of structures, or elements of
>arrays?  I think clearly the former.

The former was the only question that was asked in F08/0062.  We did not think 
we needed to write the helpful explanation so that it applied, without even 
changing any words, to other situations that were not being asked about!

And the answer clearly states that we did not want to impose a burden of partial 
initialisation via default initialisation + partial initialisation via explicit 
initialisation.  This rationale applies equally well to elements of arrays.

Besides which, F08/0062 contains no normative text to interpret.  It answers the 
question asked.  That's it.

The standard itself is quite clear, it applies equally well to array elements as 
to structure components.  This is not new, being >15year old text (qua 
subsequent wordsmithing).

................................Malcolm Cohen, Nihon NAG, Tokyo. 

More information about the J3 mailing list