To: J3 Members J3/16-279 From: Van Snyder Subject: Comments on Clause 19 References: 16-007r2 Date: 2016 October 04 1. Edits -------- [515:21,22 19.5.1.2p1] Insert "present" before "dummy argument" twice. [519:6+3 NOTE 19.9] Replace "were used in subscripts or substring ranges" with "appear" {to cover the case of actual arguments to function references, values provided in structure constructors... and it's simpler}. [519:19 19.5.2.2p1] Append a sentence at the end of the paragraph: "If a pointer is disassociated or has undefined pointer association status, its bounds if any, and the values of its deferred type parameters if any, are undefined. If it is polymorphic and disassociated, its dynamic type is the same as its declared type." {These aren't variables, so it's not obvious this description belongs instead in 19.6.6. The dynamic type certainly doesn't belong there.} [520:32+ 19.5.2.5p1(1)+] Insert a list item (or a NOTE): " (1a) the pointer is a subobject of a variable in an intrinsic assignment statement and the corresponding subobject of the expression has undefined association status," {In an intrinsic assignment statement for derived-type objects, pointer components are assigned as if by pointer assignment, so this is conceivably covered by item (1), but it's not immediately obvious, so at least a NOTE would be helpful.} [521:2+ 19.5.2.5p1(6)+] Insert a list item: " (6a) beginning execution of a BLOCK construct if the pointer is an unsaved construct entity of the construct, or a nondefault initialized subobject of an unsaved construct entity of the construct," {Item (11) does not make the pointer undefined when the construct begins execution, so we only know it's undefined when the construct begins second and subsequent executions, and (11) doesn't cover nondefault initialized pointer subobjects.} [521:12+ 19.5.2.5p1(9)(e)+] So as not to contradict 19.5.2.5p1(6-7), append a phrase after the last list item: "and its target does not become undefined," [521:18-19 19.5.2.5p1(11)] Delete list item (11) in favor of the newly-introduced item (6a). {If it becomes undefined at the beginning it doesn't matter whether it becomes undefined at the end, because it can't be referenced until the construct begins again.} [522:18 19.5.3.2p1] Insert "in bits" after "The sizes". [524:31 19.5.5p5(1)] After "the target" insert ", the values of deferred type parameters if any are the same as the values of corresponding parameters of the target, if the associating entity is polymorphic the dynamic type of the associating entity becomes the same as the dynamic type of the target". {These aren't variables, so it's not obvious this description belongs instead in 19.6.6. The dynamic type certainly doesn't belong there.} [525:1 19.5.5p5(3)] Before "and" insert "the values of assumed type parameters if any become the same as the values of corresponding type parameters of the pre-existing entity," [525:4 19.5.5p5(3)] Append a sentence: "If the entities are arrays, the association is argument association, and the shape of the associating entity is deferred, its shape becomes the same as the shape of the corresponding effective argument." [525:6 19.5.5p5(4)] Before "and" insert "the values of assumed type parameters if any become the same as the values of corresponding type parameters of the pre-existing entity," [529:12 19.6.6p1(15)(a)] Before item (a) insert a new item (a): " (a) its unsaved local variables become undefined, except for default initialized nonpointer subobjects," [529:31 19.6.6p1(18)+] Insert list items: " (18a) Completion of execution of a synchronous data transfer statement, or a wait operation, causes all s in the statement that initiated the data transfer to become undefined. (18b) Execution of an asynchronous data transfer statement causes all s in the statement to become undefined." [529:39 19.6.6p1(22)+] Insert a list item: " (22a) When execution of a BLOCK construct begins, its unsaved local variables become undefined, except for default initialized nonpointer subobjects," [530:9+ 19.6.6p1(27)+] Insert a list item: " (27a) When the target of an associated pointer becomes undefined, the pointer becomes undefined." [530:33 19.6.7p1(12)] Replace "a" with "an". 2. Comment with suggested edits ------------------------------- I hope this doesn't need an interp. 10.2.2.3p2 at [173:21] says that if a pointer target in a pointer assignment statement is allocatable, it shall be allocated. 15.5.2.7p5 at [321:1-2] says that if a nonoptional pointer dummy argument corresponds to an allocatable actual argument, the actual argument shall be allocated. I could not find a specification whether the pointer becomes disassociated, or its association status becomes undefined, if the target or actual argumemt is not allocated. It is conceivable that using some processor, some user might discover that it appears reliably to become disassociated instead of junk. Although apparently no interpretation is established, silence on the question militates against portability. Processors that detect undefined or dangling pointers might benefit from explicit guidance. It would be helpful to provide a more complete specification. Assume it becomes undefined: [173:21 10.2.2.3p2] Append "If the pointer target is allocatable and not allocated, the pointer association status becomes undefined". [321:1-2 15.5.2.7p5] Append "If the actual argument is allocatable and not allocated, the pointer association status becomes undefined". {16-271 moves 15.5.2.7p5 to [320:34 15.5.2.7p2].} [520:32+ 19.5.2.5p1(1)+] Insert list items: " (1a) the pointer is a in a pointer assignment statement and the is allocatable but not allocated, (1b) the pointer is a nonoptional dummy argument and the corresponding actual argument is allocatable but not allocated," 3. Comment without edits ------------------------ To the extent 19.5.2.3-6 and 19.5.5-6 are recapitulation of normative text from elsewhere, it would be helpful to have cross references to the normative text that supports the items. This is a substantial project. 4. Question without edits ------------------------- [530:10-1319.5.2.5p1(28)] Do event variables remain defined or become undefined?