J3/08-147 To: J3 From: Van Snyder Subject: Premature public comment: VALUE attribute Date: 2008 April 14 1. Introduction This comment is premature, but since we have very few papers for Meeting 184 we might wish to process it anyway. The restrictions on the VALUE attribute appear to be designed more to maximize vengeance, retribution, or aggravation, rather than to maximize ease of implementation of processors, or the likelihood that programs are correct. There might originally have been some intent to impose the same restrictions on it that formal parameters in C enjoy, but that parallelism vanished when it was allowed for arguments of derived type. Any benefit that might have been gotten from having a size that can be deteremined at compile time is an illusion, since the processor already has to know how to do "copy in," i.e., the same thing as VALUE, in the case of noncontiguous actual arguments corresponding to contiguous dummy arguments. VALUE is actually simpler, since "copy out" is not needed. 2. Suggested changes The constraints on the VALUE attribute ought to be reduced: [49: 4.3.1.1p1 C407] --------------------------------------------------- Delete the final sentence of C407 that deals with the VALUE attribute: "It shall not have the VALUE attribute." [67: 4.5.4.5p4 C455] --------------------------------------------------- Delete the final sentence of C455 that deals with the VALUE attribute: "It shall not have the VALUE attribute." [99: 5.3.18p1 C556-558] ------------------------------------------------ C556 An entity with the VALUE attribute shall be a dummy data object that is not an assumed-size array. C557 An entity with the VALUE attribute shall not have the INTENT(INOUT) or INTENT(OUT) attribute. or maybe C557 An entity with the VALUE attribute shall not have the CODIMENSION, INTENT(INOUT), or INTENT(OUT) attribute. [288: 12.5.2.3p4] ------------------------------------------------------ Editor: Insert "nonpointer nonallocatable" before "dummy argument". Insert "extents, length type parameter values, and" before "initial". [291: 12.5.2.5p5+] ----------------------------------------------------- Editor: Insert new paragraphs: If a present pointer dummy argument that has the VALUE attribute corresponds to a pointer actual argument, the dummy argument has the same pointer association status as the actual argument; if the actual argument is associated with a target the dummy argument becomes associated with the same target, and has the same bounds and length type parameter values as the actual argument. If a present pointer dummy argument that has the VALUE attribute corresponds to a nonpointer actual argument, the dummy argument becomes pointer associated with the actual argument, and has the same extents and length type parameter values as the actual argument. If a present allocatable dummy argument that has the VALUE attribute corresponds to an allocated allocatable actual argument, the dummy argument becomes allocated with the same bounds, length type parameter values, and value as the actual argument. The value of the actual argument shall not be undefined. If a present allocatable dummy argument that has the VALUE attribute corresponds to an unallocated allocatable actual argument, the dummy argument becomes unallocated.