07-222 To: J3 From: Malcolm Cohen Subject: SAVE attribute, modules, main programs Date: 2007 May 09 1. Introduction We say in four places "SAVE attribute or ... declared in a main program" et cetera. This is clumsy, especially now we have to say "or the specification part of a module or submodule". We also missed adding the module/submodule case in one place. We also missed out the "specification part" or "scoping unit" in some places, making the text incorrect. This kind of thing is happening because we say that SAVE doesn't do anything in a main program, module or submodule. 2. Proposal That we implicitly give the SAVE attribute in those places, and allow it to be confirmed. This is the same artifice we use for initialised variables, so if it works for them it will work for us. That allows us to simplify the wording in several places. 3. Edits to 07-007r1 [68:4.5.4.5p4+0-1] Change "has the TARGET attribute, either has the SAVE attribute or is declared in the main program," to "has both the TARGET and SAVE attributes," {This is the place we missed - it is for "initialization target".} [76:Note 4.52+0-1] Delete "or that is declared in the main program, a module, or a submodule". {Simplification. Existing wording is broken!} [88:37] Replace entire constraint with "An automatic object shall not have the SAVE attribute." {Simplification.} [93:C528] Replace entire constraint with "A co-array or an object with a co-array ultimate component shall have the SAVE attribute unless it is allocatable or a dummy argument." {Simplification. Previous wording was arguably broken since it implied that mere possession of the SAVE attribute was not enough, it had to have the SAVE attribute "specified" for it.} [102:5.3.15p5+0] Replace first sentence "The SAVE attribute has no effect..." by "A variable, common block, or procedure pointer declared in the scoping unit of a main program, module, or submodule implicitly has the SAVE attribute, which may be confirmed by explicit specification." {Longer but makes wording elsewhere safer and simpler. Note: previous wording broken - did not mention "scoping unit"!} [484:16.5.2.2.3p1 item (8)(d)] Delete item. {Simplification - no longer needed.} ===END===