(j3.2006) Is this or is this not F95-standard conformant?

Bill Long longb
Sat Nov 13 16:03:24 EST 2010

On 11/10/10 7:29 PM, Malcolm Cohen wrote:
> Van Snyder wrote:
>> Is line 19 of the little attached program F95-standard conformant?
> Obviously not.
>> It looks like items (7)(d) and (7)(second b) at [97-007r2:94:17,21]
>> allow it, since the property inquired about is the kind type parameter
>> value.  In 10-007 the equivalent is 7.1.12p1(4)(b) at [151:29].
> "An initialization expression is a constant expression in which ... and where
> each subscript ... is an initialization expression."
> The subscript "I" in the expression is not itself an initialization expression
> so it violates this requirement.
> The presence of intrinsic functions such as LEN and SIZE in the list of
> permitted inquiries makes it easy to see why this requirement exists.

Still, it seems like the rules are overly restrictive.  The point of 
constant expressions is that they can be evaluated at compile time.  The 
KIND intrinsic result can be determined at compile time independent of 
the nature of the argument (as long as it is a valid argument).   It 
would seem to make more sense to special case an intrinsic like KIND, 
since Van's example illustrates a capability that could be useful in 
general and could easily be made conforming with a change in the standard.


> BTW, detection of the violation of the requirement is mandatory in the context
> of the constraint for rule R730.
> Similar text and constraints exist in F2010.
> Cheers,

Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101

More information about the J3 mailing list