CVS difference for ais/ai-00216.txt

Differences between 1.12 and version 1.13
Log of other versions for file ais/ai-00216.txt

--- ais/ai-00216.txt	2003/03/04 04:56:21	1.12
+++ ais/ai-00216.txt	2003/05/24 00:51:34	1.13
@@ -1,4 +1,4 @@
-!standard B.03.03      (00)                         03-02-17  AI95-00216/11
+!standard B.03.03      (00)                         03-05-03  AI95-00216/12
 !standard B.03         (60.2)
 !class amendment 99-03-23
 !status Amendment 200Y 03-02-17
@@ -50,25 +50,25 @@
 the size C would allocate for the corresponding struct/union, which will be at
 least the maximum size required for any discriminant value.  This is because
 any whole-object assignments performed to or from such an object by the C code
-will generally involve this maximum size, even if they preserve the
+will generally involve this maximum size, even if the assignments preserve the
 (conceptual) discriminant value.
 
-Each discriminant of an object of an unchecked_union type must be specified
+Each discriminant of an object of an unchecked union type must be specified
 (explicitly or implicitly) when the object is created, even though its value is
 not stored, to enable appropriate default initialization of the appropriate
 variants, or to determine which fields should appear in a record aggregate.
 
-Within the definition of an unchecked_union type, the discriminants may not be
+Within the definition of an unchecked union type, the discriminants may not be
 used in a constraint in a component_definition, unless the type of the
-component is itself an unchecked_union type. This is to ensure that the size
-of the component does not depend on the value of the discriminant. Note that
-the discriminant may be used to govern a discriminant part or as a default
+component is itself an unchecked union type. This is to ensure that the size
+of the component does not depend on the value of a discriminant. Note that
+a discriminant may be used to govern a discriminant part or as a default
 initial value for a component.
 
 Outside the definition of the object's type, a discriminant of an object of an
-unchecked_union type must not be read.
+unchecked union type must not be read.
 
-Constrained subtypes of an unchecked_union type are permitted, as this may be
+Constrained subtypes of an unchecked union type are permitted, as this may be
 necessary to specify the (initial) discriminant value for a variable
 or subcomponent having the type. It is erroneous to perform any operation (in
 C or Ada) that would have failed a discriminant check had the discriminant been
@@ -166,9 +166,10 @@
 The completion of an incomplete or private type declaration having a
 known_discriminant_part shall not be an unchecked union type.
 
-An unchecked union subtype shall not be passed as a generic actual parameter
-if the corresponding formal type has a known_discriminant_part or
-is a formal derived type that is not an unchecked union type.
+An unchecked union subtype shall only be passed as a generic actual
+parameter if the corresponding formal type does not have
+a known_discriminant_part, or is a formal derived type that is an
+unchecked union type.
 
                 Static Semantics
 
@@ -218,7 +219,7 @@
               Implementation Permissions
 
 An implementation may require that pragma Controlled be specified for the type
-of an access subcomponent of an Unchecked_Union type.
+of an access subcomponent of an unchecked union type.
 
 Notes
 
@@ -260,7 +261,7 @@
         } u;
     };
 
-This would map to the following unchecked_union type in Ada:
+This would map to the following unchecked union type in Ada:
 
     type Sym;
     type Sym_Ptr is access Sym;
@@ -269,7 +270,7 @@
 
     type Sym(Kind : Sym_Kind_Enum := Sym_Kind_Enum'First) is record
         Id : Integer := Assign_Id(Kind);
-        Name : C_Ptr;
+        Name : Interfaces.C,Strings.Chars_Ptr;
         case Kind is
             when Obj_Kind =>
                 Obj_Type : Sym_Ptr;
@@ -297,14 +298,14 @@
 and nested variants.  The need to eliminate the storage for
 the discriminant exists for these more complex uses of "union" in C
 just as much as it exists for a very simple use of "union."  Hence,
-we propose to allow unchecked_union types to include non-variant
+we propose to allow unchecked union types to include non-variant
 parts along with variant parts, to include multiple components
 per variant, and to support nested variants, to maximize the likelihood
 that there is a natural mapping possible between the C type
 structure and the Ada type structure.
 
 We have also defined rules that should eliminate generic contract
-model violations related to unchecked_unions, as this seems important
+model violations related to unchecked unions, as this seems important
 if such types are going to be used in relatively portable C interfacing
 code with compilers that may share generics.
 
@@ -334,7 +335,7 @@
 
 The form of a pragma Unchecked_Union is as follows:
 
-@xindent<@b<pragma> Unchecked_Union (@i<first_subtype_local_>@fa<name>);>
+@xindent<@b<pragma> Unchecked_Union (@i<first_subtype_>@fa<local_name>);>
 
 @i<@s8<Legality Rules>>
 
@@ -346,7 +347,7 @@
 
 A type to which a pragma Unchecked_Union applies is called an
 @i<unchecked union type>. A subtype of an
-unchecked union type is defined to br an @i<unchecked union subtype>.
+unchecked union type is defined to be an @i<unchecked union subtype>.
 An object of an unchecked union type is defined to be an @i<unchecked union
 object>.
 
@@ -368,6 +369,11 @@
 if the corresponding formal type has a @fa<known_discriminant_part> or
 is a formal derived type that is not an unchecked union type.
 
+An unchecked union subtype shall only be passed as a generic actual
+parameter if the corresponding formal type does not have
+a @fa<known_discriminant_part>, or is a formal derived type that is an
+unchecked union type.
+
 @i<@s8<Static Semantics>>
 
 An unchecked union type is eligible for convention C.
@@ -417,7 +423,7 @@
 @i<@s8<Implementation Permissions>>
 
 An implementation may require that @fa<pragma> Controlled be specified for the
-type of an access subcomponent of an Unchecked_Union type.
+type of an access subcomponent of an unchecked union type.
 
 @xindent<@s9<NOTES@hr
 15 The use of an unchecked union to obtain the effect of an

Questions? Ask the ACAA Technical Agent