CVS difference for ai12s/ai12-0059-1.txt

Differences between 1.10 and version 1.11
Log of other versions for file ai12s/ai12-0059-1.txt

--- ai12s/ai12-0059-1.txt	2016/03/18 03:31:15	1.10
+++ ai12s/ai12-0059-1.txt	2016/04/21 03:28:46	1.11
@@ -1,8 +1,8 @@
-!standard 4.9.1(2/3)                              16-03-17    AI12-0059-1/08
+!standard 4.9.1(2/3)                              16-04-20    AI12-0059-1/09
 !standard 13.1(14)
 !standard 13.1(23)
-!standard 13.3(9/1)
-!standard 13.3(50)
+!standard 13.3(9/3)
+!standard 13.3(50/2)
 !standard 13.3(51)
 !standard 13.3(52)
 !standard 13.3(58)
@@ -144,11 +144,12 @@
 will be placed in the Standard. As such, it does not mention aspect
 specifications, it only talks about the attribute. This is intended.]
 
-Modify 13.3(9/1):
+Modify 13.3(9/3):
 The following representation attributes are defined: Address, Alignment,
-Size, {Object_Size, }Storage_Size, and Component_Size.
+Size, {Object_Size, }Storage_Size, Component_Size, Has_Same_Storage, and
+Overlaps_Storage.
 
-Change 13.3(50) to:
+Change 13.3(50/2) to:
 
 If the Size of a subtype is nonconfirming and allows for efficient independent
 addressability (see 9.10) on the target architecture, then the Object_Size of
@@ -243,7 +244,7 @@
     * X is a nonaliased stand-alone object; or
     * The size of X is determined by a component_clause or Component_Size
       clause; or
-    * Pragma Pack applies to the type containing component X.
+    * The type containing component X is packed.
 
 An Object_Size clause on a composite type should not affect the internal
 layout of components.
@@ -353,7 +354,7 @@
        with Object_Size = 32;
 
     subtype Our_Natural is Our_Integer range 0 .. Our_Integer'Last;
-       -- Our_Natural'Size = 31, Our_Natural'Size = 32.
+       -- Our_Natural'Size = 31, Our_Natural'Object_Size = 32.
 
     type Test_Rec is record
         A : aliased Our_Natural;
@@ -364,9 +365,151 @@
         B at 0 range Our_Natural'Object_Size .. Our_Natural'Object_Size;
     end record;
 
+!corrigendum 4.9.1(2/3)
+
+@drepl
+A subtype @i<statically matches> another subtype of the same type if they have
+statically matching constraints, all predicate specifications that apply to
+them come from the same declarations, and, for access subtypes, either both or
+neither exclude null. Two anonymous access-to-object subtypes statically match
+if their designated subtypes statically match, and either both or neither
+exclude null, and either both or neither are access-to-constant. Two anonymous
+access-to-subprogram subtypes statically match if their designated profiles are
+subtype conformant, and either both or neither exclude null. 
+@dby
+A subtype @i<statically matches> another subtype of the same type if they have
+statically matching constraints, all predicate specifications that apply to
+them come from the same declarations, Object_Size (see 13.3) has been specified
+to have a nonconfirming value for either both or neither, and the nonconfirming
+values, if any, are the same, and, for access subtypes, either both or
+neither exclude null. Two anonymous access-to-object subtypes statically match
+if their designated subtypes statically match, and either both or neither
+exclude null, and either both or neither are access-to-constant. Two anonymous
+access-to-subprogram subtypes statically match if their designated profiles are
+subtype conformant, and either both or neither exclude null. 
+
+!corrigendum 13.1(14)
+
+@drepl
+If two subtypes statically match, then their subtype-specific aspects (Size and
+Alignment) are the same.
+@dby
+If two subtypes statically match, then their subtype-specific aspects (for
+example, Size and Alignment) are the same.
+
+!corrigendum 13.1(23)
+
+@drepl
+An implementation need not support a specification for the Size for a given
+composite subtype, nor the size or storage place for an object (including a
+component) of a given composite subtype, unless the constraints on the subtype
+and its composite subcomponents (if any) are all static constraints.
+@dby
+An implementation need not support a specification for the Object_Size or Size
+for a given composite subtype, nor the size or storage place for an object
+(including a component) of a given composite subtype, unless the constraints
+on the subtype and its composite subcomponents (if any) are all static
+constraints.
+
+!corrigendum 13.3(9/3)
+
+@drepl
+The following representation attributes are defined: Address, Alignment, Size,
+Storage_Size, Component_Size, Has_Same_Storage, and Overlaps_Storage.
+@dby
+The following representation attributes are defined: Address, Alignment, Size,
+Object_Size, Storage_Size, Component_Size, Has_Same_Storage, and
+Overlaps_Storage.
+
+!corrigendum 13.3(50/2)
+
+@drepl
+If the Size of a subtype allows for efficient independent addressability
+(see 9.10) on the target architecture, then the Size of the following objects
+of the subtype should equal the Size of the subtype:
+@dby
+If the Size of a subtype is nonconfirming and allows for efficient independent
+addressability (see 9.10) on the target architecture, then the Object_Size of
+the subtype should have the same value in the absence of an explicit
+specification of a different value.
+
+!corrigendum 13.3(51)
+
+@ddel
+@xbullet<Aliased objects (including components).>
+
+!corrigendum 13.3(52)
+
+@ddel
+@xbullet<Unaliased components, unless the Size of the component is determined
+by a @fa<component_clause> or Component_Size clause. >
+
+!corrigendum 13.3(58)
+
+@dinsa
+@s9<7  A @fa<component_clause> or Component_Size clause can override a
+specified Size. Aspect Pack cannot.>
+@dinss
+@s8<@i<Static Semantics>>
+
+For every subtype S:
+
+@xhang<@xterm<S'Object_Size>
+If S is definite, denotes the size (in bits) of a
+stand-alone aliased object, or a component of subtype S in the absence
+of an @fa<aspect_specification> or representation item that specifies the
+size of the object or component. If S is indefinite, the meaning is
+implementation-defined. The value of this attribute is of the type
+@i<universal_integer>. If not specified otherwise, the Object_Size of a
+subtype is at least as large as the Size of the subtype. Object_Size may
+be specified via an @fa<attribute_definition_clause>; the expression of such
+a clause shall be static and its value nonnegative. All aliased objects
+with nominal subtype S have the size S'Object_Size. In the absence of
+an explicit specification, the Object_Size of a subtype S defined by a
+@fa<subtype_indication> without a constraint, is that of the value of the
+Object_Size of the subtype denoted by the @fa<subtype_mark> of the
+@fa<subtype_indication>, at the point of this definition.>
+
+@s8<@i<Implementation Advice>>
+
+If S is a definite first subtype and S'Object_Size is not specified,
+S'Object_Size should be the smallest multiple of the storage element size
+larger than or equal to S'Size that is consistent with the alignment of S.
+
+If X denotes an object (including a component) of subtype S, X'Size should
+equal S'Object_Size, unless:
+
+@xbullet<X'Size is specified; or>
+@xbullet<X is a nonaliased stand-alone object; or>
+@xbullet<The size of X is determined by a @fa<component_clause> or
+Component_Size clause; or>
+@xbullet<The type containing component X is packed.>
+
+An Object_Size clause on a composite type should not affect the internal
+layout of components.
+
+The recommended level of support for the Object_Size attribute of subtypes is:
+
+@xbullet<If S is a static signed integer subtype, the implementation should
+support the specification of S'Object_Size to match the size of any signed
+integer base subtype provided by the implementation that is no smaller than
+S'Size. Corresponding support is expected for modular integer subtypes,
+fixed point subtypes, and enumeration subtypes.>
+
+@xbullet<If S is an array or record subtype with static constraints and S is
+not a first subtype of a derived untagged by-reference type, the implementation
+should support the specification of S'Object_Size to be any multiple of the
+storage element size that is consistent with the alignment of S, that is
+no smaller than S'Size, and that is no larger than that of the largest
+composite subtype supported by the implementation.>
+
+@xbullet<If S is some other subtype, only confirming specifications of
+Object_Size need be supported.>
+
 !ASIS
 
-** TBD **
+Presumably a new attribute value will be needed, it's unknown if any other
+changes are needed.
 
 !ACATS test
 
@@ -1145,6 +1288,40 @@
 over 4.9.1 -- I think the current wording is the best of a set of nasty
 alternatives.  We now rely on the existing rule in 13.1(14) about static
 matching implies subtype-specific aspect matching.  Enjoy!
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Wednesday, April 20, 2016  9:03 PM
+
+This is a for-the-record message; you don't need to reply unless you object to
+something in it. As usual, I'm considering these as my editorial review.
+
+We have a bullet:
+  * Pragma Pack applies to the type containing component X.
+
+(1) We don't talk about Pragma Pack in the RM anymore; we talk about aspect
+Pack. So:
+  * Aspect Pack applies to the type containing component X.
+(2) However, the above isn't really right, as one could (bizarrely) specify
+Pack => False (which does nothing). And aspects don't "apply" anyway. So we
+really ought to make clear what we want:
+  * Aspect Pack is True for the type containing component X.
+(3) 13.2 defines the term "packed" for types for which aspect Pack is True
+(for whatever reason). It's probably better to use that anyway, because that
+makes this wording less likely to need maintenance. (If the new frobnitz
+feature of Ada 2042 causes types to become packed, we won't need to change
+this wording.) So:
+  * The type containing component X is packed.
+
+---
+
+This AI originated as AI95-00319-1, originally written in 2002. Thus, it isn't
+surprising that several of the paragraphs are modified from the wrong (pre-Ada
+2005) wording. (It is surprising that none of the reviewers caught that for
+this AI.) For instance, the AI references 13.3(9/1), but Ada 2012 changed that
+paragraph, the correct number being 13.3(9/3). I've corrected these. Several
+AARM notes have similar issues.
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent