J3/09-299 To: J3 Subject: ASYNCHRONOUS and VOLATILE in BLOCK From: Bill Long Date: 2009 November 08 Discussion: The draft currently allows a program to give the ASYNCHRONOUS or VOLATILE attribute to a variable within a block, whilst the same variable does not have the attribute outside the block. This feature presents significant implementation difficulties. Compilers normally associate attributes with a variable on a scoping-unit basis, resulting a variable tagged using this feature ending up with the attribute everywhere it exists, defeating the intent of the feature. Furthermore, it is hard to determine whether these declarations create a new variable or just modify the attributes of an existing variable. The variable might appear in a statement thousands of lines later and, because of implicit typing, be a variable global to the programming unit and not local to the BLOCK. The compiler would need to determine this state to know whether to save the value of the variable or to remove its existence a the end of the block. The chances for user error are significant. Given these difficulties, the capability of giving the ASYNCHRONOUS or VOLATILE attributes to a variable in a BLOCK should be removed unless the variable is also declared as a construct entity in the same block. This makes the treatment of the ASYNCHRONOUS and VOLATILE attributes consistent with other attributes in block declarations. Edits for 09-007r3: [90:21-22] In "5.3.4 ASYNCHRONOUS attribute", para 4, delete the second sentence which reads "Within a BLOCK construct ... outside the BLOCK construct." [102:11-12] In "5.3.19 VOLATILE attribute" delete the third constraint, C561. {The 'that is not a construct entity' qualification is no longer possible}. [102:14-15] In "5.3.19 VOLATILE attribute" para 2, delete the second sentence which reads "Within a BLOCK construct ... outside the BLOCK construct". [172:4-7] In "8.1.4 BLOCK construct", para 2, replace "Except for the ASYNCHRONOUS and VOLATILE statements, specifications" with "Specifications". Delete the second sentence of the paragraph, which reads "The appearance of the name ... outside the construct". {As a result the entire paragraph becomes the single sentence "Specifications in a BLOCK construct declare construct entities whose scope is that of the BLOCK construct (16.4)."} [444:15] In "16.4 Statement and construct entities", in the third sentence of para 1, delete ", other than only in ASYNCHRONOUS and VOLATILE statements,". {As a result the sentence becomes "An entity that is explicitly declared in the specification part of a BLOCK construct is a construct entity."}