Version 1.1 of ais/ai-00366.txt

Unformatted version of ais/ai-00366.txt version 1.1
Other versions for file ais/ai-00366.txt

!standard 10.2.1          03-12-14 AI95-00366/01
!class amendment 03-12-14
!status work item 03-12-14
!status received 03-12-14
!priority Medium
!difficulty Easy
!subject More liberal rule for Pure units
!summary
Pure units allow access-to-subprogram tyes and access-to-object types, for which no storage pool is created.
!problem
In pure units access-to-subprogram types and access-to-object types, for which no storage pool is created, are presently prohibited. There is no technical reason for the restriction and many packages that should be pure can not be declared pure.
!proposal
(see wording)
!wording
Replace 10.2.1(16) A pure library_item is a preelaborable library_item that does not contain the declaration of any variable or named access type, except within a subprogram, generic subprogram, task unit, or protected unit. by: A pure library_item is a preelaborable library_item that does not contain the declaration of any variable or named access-to-object type, for which the Storage_Size has not been specified to be 0, excepting declarations within a subprogram, generic subprogram, task unit, or protected unit.
!discussion
Pure implies that a unit has no state. Access-to-object types are associated with storage pools, which constitute state. However, access-to-subprogram types have no such implications. Hence they should not be excluded. A corresponding correction of 10.2.1(16) would read: A pure library_item is a preelaborable library_item that does not contain the declaration of any variable or named access-to-object type, except within a subprogram, generic subprogram, task unit, or protected unit.
Beyond access-to-subprogram types, some packages have a need for an access-to-object type, without a need for a storage pool for the type, however. Setting the Storage_size of the type to zero implies that no storage pool (and hence no state) needs to be created.
The proposed !wording reflects these observations and removes the restriction on the presence of such access types.
!example
--!corrigendum
!ACATS test
An ACATS test checking that such types are allowed in Pure units should be constructed.
!appendix

****************************************************************

Questions? Ask the ACAA Technical Agent