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

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

--- ai12s/ai12-0059-1.txt	2016/02/16 03:20:40	1.9
+++ ai12s/ai12-0059-1.txt	2016/03/18 03:31:15	1.10
@@ -1,4 +1,4 @@
-!standard 4.9.1(2/3)                              15-11-19    AI12-0059-1/07
+!standard 4.9.1(2/3)                              16-03-17    AI12-0059-1/08
 !standard 13.1(14)
 !standard 13.1(23)
 !standard 13.3(9/1)
@@ -75,7 +75,7 @@
 A subtype 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 either for both or
+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.
 
@@ -98,7 +98,7 @@
 Modify 13.1(14):
 
 If two subtypes statically match, then their subtype-specific aspects
-({for  example, }Size and Alignment) are the same.
+({for example, }Size and Alignment) are the same.
 
 Modify AARM 13.1(14.a/3):
 
@@ -208,8 +208,8 @@
 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 S'Size that is consistent with the alignment of S.
+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.
 
 AARM Note
     Reason: Many implementations "round up" allocations to the nearest multiple
@@ -239,10 +239,11 @@
 
 If X denotes an object (including a component) of subtype S, X'Size should
 equal S'Object_Size, unless:
-    X'Size is specified; or
-    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.
+    * X'Size is specified; or
+    * 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.
 
 An Object_Size clause on a composite type should not affect the internal
 layout of components.
@@ -308,7 +309,7 @@
 
 This also can occur for Object_Size. It is not as likely as with Size
 (Object_Size has only a weakly suggested value, so it is likely that
-T'Object_Size = T'Base'Object_Size in the absense of a specification for
+T'Object_Size = T'Base'Object_Size in the absence of a specification for
 T'Object_Size). Moreover, this behavior is not really a problem. There is no
 problem with using a different Object_Size for an "expanding" subtype,
 as it cannot statically match the base subtype.
@@ -326,7 +327,7 @@
 
 ============================
 
-Note that (Sub)type'Size is not a significant problem for composite types; the
+Note that (sub)type'Size is not a significant problem for composite types; the
 language there does not require bizarre values for 'Size. So a solution only
 really needs to apply to scalar types.
 
@@ -346,7 +347,22 @@
 
 !example
 
-(* TBD. *)
+The example in the problem statement could be made portable:
+
+    type Our_Integer is range 2**31-1 .. 2**31-1
+       with Object_Size = 32;
+
+    subtype Our_Natural is Our_Integer range 0 .. Our_Integer'Last;
+       -- Our_Natural'Size = 31, Our_Natural'Size = 32.
+
+    type Test_Rec is record
+        A : aliased Our_Natural;
+        B : Boolean;
+    end record;
+    for Test_Rec use record
+        A at 0 range 0 .. Our_Natural'Object_Size-1;
+        B at 0 range Our_Natural'Object_Size .. Our_Natural'Object_Size;
+    end record;
 
 !ASIS
 

Questions? Ask the ACAA Technical Agent