X3J3/96-154 Date: September 25, 1996 To: X3J3 From: Jeanne Martin Subject: M.4 - Specifying Pointer Lower Bounds References: 120-JTM-8 (November 1991) WG5 Standing Document 5 (Repository), Item 2 X3J3/96-004 (JOR), Item 18 X3J3/96-057 User control of pointer bounds X3J3/96-058 Proposal A X3J3/96-059 Proposal B X3J3/96-064 More about controlling pointer bounds X3J3/96-121 User control of pointer bounds X3J3/96-007R1 Rationale: Given the following declarations: real, target :: b(0:9) real, pointer :: a(:), b_first(:), b_last(:) The situation with Fortran 95 is: a => b ! bounds are (0:9) a => b(:) ! bounds are (1:10) b_first => b(0:4) ! bounds are (1:5) b_last => b(5:9) ! bounds are (1:5) There is no way for the user to alter this determination of bounds. This proposal changes that by adding an optional lower bound specifier to the left side of the pointer assignment statement. This allows a user to write: a(0:) => b ! bounds are (0:9) a(0:) => b(:) ! bounds are (0:9) b_first(0:) => b(0:4) ! bounds are (0:4) b_last(5:) => b(5:9) ! bounds are (5:9) b_last(0:) => b(5:9) ! bounds are (0:4) Edits: Page 110, line 39, change to R736 pointer-assignment-stmt is pointer-object [ (bounds-spec-list) ] => target R736a bounds-spec is lower-bound : Page 110, after line 42, add Constraint: The number of s specified shall be equal to the rank of . Page 111, after line 22, add to NOTE 7.46 WINDOW2(0:, 0:) => MAT2D (ML:MU, NL:NU) Page 55, lines 41 through 45, change to (2) They are specified in a pointer assignment statement. If a is present, it specifies the lower bound for each dimension that is not of zero extent. The lower bound for a dimension of zero extent is 1. The extent of a dimension of a pointer is the extent of the corresponding dimension of the target. If the lower bound is d and the extent of the corresponding dimension of the target is s, the value of the upper bound is s + d - 1. If the lower bounds are not specified, the lower bound of each dimension is the result of the intrinsic function LBOUND (13.14.53) applied to the correspon- ding dimension of the target. _______________________________________________________________________________ Jeanne Martin email: jtm@llnl.gov phone: (510) 422-3753 postal code: L-561 fax: (510) 423-8704 Lawrence Livermore National Laboratory Livermore, CA 94550