J3/10-212 To: J3 From: Malcolm Cohen Subject: Interp: VALUE attribute restrictions. Date: 2010 September 26 ---------------------------------------------------------------------- NUMBER: F08/? TITLE: VALUE attribute restrictions. KEYWORDS: VALUE DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Consider the program unit SUBROUTINE s(x,y,n) REAL,VALUE :: x(:) CHARACTER(n),VALUE :: y DO i=2,SIZE(x) x(i) = x(i) + x(i-1) END DO PRINT *,y,x END SUBROUTINE This is not valid in Fortran 2003 as it violates constraint C527 "If the VALUE attribute is specified, the ... DIMENSION ... attribute shall not be specified." and also violates constraint C528 "If the VALUE attribute is specified, the length type parameter values shall be omitted or specified by initialization expressions." The corresponding constraint to F2003/C527 for Fortran 2008, C558, does not prohibit the DIMENSION attribute. There does not appear to be any constraint in F2008 corresponding to F2003/C528. Therefore this program unit is apparently now syntactically correct. However, the Introduction to the Fortran 2008 standard does not mention these as new features. Is the omission of these requirements an oversight? ANSWER: No, these are deliberate additions to the language. An edit is supplied to clarify the Introduction. EDITS: {to 10-007} [xiii] Introduction, bullet "Data declaration", append "The VALUE attribute is permitted for an array, and for an object with a nonconstant length type parameter." SUBMITTED BY: Malcolm Cohen HISTORY: 10-212 m193 Submitted ----------------------------------------------------------------------