To: J3 Members J3/17-150 From: Van Snyder Subject: COMMON and SAVE References: 17-007r1 Date: 2017 May 12 1. Discussion ============= Subclause 8.5.16 allows to specify the SAVE attribute for a common block, but its first paragraph limits its effect to local variables. Subclause 19.2 says that common blocks are global entities (but doesn't say whether variables in them are local or global entities; I assume they're global). Subclause 3.154.2 explicitly excludes global entities from the definition of local variable. Therefore, variables in common blocks need excplicitly to be included in 8.5.16p1. Subclause 8.10.2.5 says that variables in blank common never become undefined as the result of executing a RETURN or END statement. Although this sort-of repeats some of the definition of the SAVE attribute in 8.5.16p1, there is no specification whether variables in blank common actually have the SAVE attribute, or do not have the attribute. Because 8.10.2.5 is incomplete, it's not obvious, for example, whether a pointer in blank common becomes undefined if its target becomes undefined. 8.10.2.5 says no (there's no "except if it's a pointer and its target becomes undefined"), but 8.5.16 says yes. This probably should have been addressed by an interp against F90. It would be more economical, and remove all ambiguity, simply to say blank common blocks have the SAVE attribute. 2. Edits ======== [111:19 8.5.16p1 SAVE attribute] After "subprogram" insert "\obs{, or a variable in a common block,}". [111:20 8.5.16p1 SAVE attribute] Replace "it" with "the variable or a subobject of it" [111:26+ 8.5.16p2+ SAVE attribute] Although 19.6.1 specifies that if a subobject is undefined, the object is undefined, and therefore a variable with the SAVE attribute cannot become undefined as a result of one of its subobjects becoming undefined as a result of executing a RETURN or END statement, to remove all doubt about the purview of the SAVE attribute, insert a paragraph: "If a variable has the SAVE attribute, all of its subobjects have the SAVE attribute." {This could be made the first sentence of 8.5.16p3 instead of being a separate paragraph.} [112:1 8.5.16p3 SAVE attribute] Append a sentence: "A blank common block has the SAVE attribute." [128:32 8.10.2.5p1 Differences between named common and blank common] After "common block" insert "that has the SAVE attribute (8.5.16)" (in \obs font). [128:33-34 8.10.2.5p1 Differences between named common and blank common] Delete the first list item, viz. "Execution of a RETURN ... undefined (19.6.6)" because it defectively explains only some of the difference between having the SAVE attribute and not having it.