CVS difference for ais/ai-00161.txt

Differences between 1.19 and version 1.20
Log of other versions for file ais/ai-00161.txt

--- ais/ai-00161.txt	2005/10/31 05:18:08	1.19
+++ ais/ai-00161.txt	2005/12/15 02:43:45	1.20
@@ -1,9 +1,9 @@
-!standard 10.02.01 (04)                               05-10-10  AI95-00161/12
+!standard 10.02.01 (04)                               05-12-01  AI95-00161/13
 !standard 10.02.01 (09)
 !standard 10.02.01 (11)
 !standard  7.06 (05)
 !standard  7.06 (07)
-!standard 13.07 (12)
+!standard 13.07 (34)
 !standard 13.11 (06)
 !standard 13.13.1 (03)
 !standard A.04.02 (04)
@@ -86,9 +86,9 @@
 preelaborable initialization.
 
 - A derived type has preelaborable initialization if its parent type has
-preelaborable initialization and (in the case of a derived record or protected
-type) if the non-inherited components all have preelaborable initialization.
-Moreover, a user-defined controlled type with an overriding
+preelaborable initialization and (in the case of a derived record extension)
+if the non-inherited components all have preelaborable initialization.
+However, a user-defined controlled type with an overriding
 Initialize procedure does not have preelaborable initialization.
 
 - A view of a type has preelaborable initialization if it is an elementary
@@ -178,9 +178,14 @@
 Ada.Strings.Maps.Character_Set                                  yes
 Ada.Strings.Unbounded.Unbounded_String                          yes
 Interfaces.C.Strings.Chars_Ptr                                  yes
-System.Address                                                  yes
+System.Address                                                  yes*
 System.Storage_Pool.Root_Storage_Pool                           yes
 
+(*) Type System.Address *might* be a private type. As such, we simply say
+that it has preelaborable initialization, and leave it to the implementation
+to figure out how to accomplish that. We don't want to apply the pragma to
+it, because it might not be a type that allows the pragma.
+
 Note: The type Bounded_String cannot have a pragma
 Preelaborable_Initialization, because that would make it impossible to
 instantiate Generic_Bounded_Length with a non-static expression for the
@@ -255,9 +260,9 @@
 include a default expression and its type has preelaborable initialization.>
 
 @xbullet<A derived type has preelaborable initialization if its parent type has
-preelaborable initialization and (in the case of a derived record or protected
-type) if the non-inherited components all have preelaborable initialization.
-Moreover, a user-defined controlled type with an overriding
+preelaborable initialization and (in the case of a derived record extension)
+if the non-inherited components all have preelaborable initialization.
+However, a user-defined controlled type with an overriding
 Initialize procedure does not have preelaborable initialization.>
 
 @xbullet<A view of a type has preelaborable initialization if it is an
@@ -286,15 +291,17 @@
 In a @fa<generic_instantiation> the corresponding actual type shall have
 preelaborable initialization.
 
-!corrigendum  13.07(12)
+!corrigendum  13.07(34)
 
 @drepl
-@xcode<    @b<type> Address @b<is> @i<implementation-defined>;
-    Null_Address : @b<constant> Address;>
+Address is of a definite, nonlimited type. Address represents machine addresses
+capable of addressing individual storage elements. Null_Address is an address
+that is distinct from the address of any object or program unit.
 @dby
-@xcode<    @b<type> Address @b<is> @i<implementation-defined>;
-    @b<pragma> Preelaborable_Initialization(Address);
-    Null_Address : @b<constant> Address;>
+Address is a definite, nonlimited type with preelaborable initialization (see
+10.2.1). Address represents machine addresses
+capable of addressing individual storage elements. Null_Address is an address
+that is distinct from the address of any object or program unit.
 
 !corrigendum  13.11(06)
 
@@ -634,6 +641,53 @@
 special kludge in the compiler to allow this for internal implementation
 units (there is no rule in the RM that requires library packages to be
 written in Ada :-)
+
+****************************************************************
+
+!topic Preelaborable_Initialization(System.Address) may be illegal
+!reference RM05 10.2.1(11.7/2), 13.7(12/2), 13.7(37)
+!from Adam Beneschan 05-12-09
+!discussion
+
+Minor nitpick in the Amendment:
+
+13.7 gives the definition of Address, in package System, as:
+
+   type Address is <implementation-defined>;
+   pragma Preelaborable_Initialization(Address);
+
+The Implementation Advice in 13.7(37) says that Address should be a
+private type, but does not require this.  If an implementation ignores
+this advice and defines it in a different way, the
+Preelaborable_Initialization pragma is most likely illegal, since
+10.2.1(11.7/2) allows this pragma to be applied only to private types,
+private extensions, and entryless protected types.
+
+This is probably not be a major issue---if there are any
+implementations left that don't define Address as a private type, they
+will almost certainly define it as a type that will have preelaborable
+initialization by the rules of 10.2.1.  (For such implementations,
+does there need to be a rule explicitly stating that [the partial view
+of] System.Address shall have preelaborable initialization?)  Also,
+there's no requirement that language-defined packages have to be
+compiled using an Ada compiler that obeys all the language rules.
+Still, it looks a little bad (in my opinion) to have 13.7 give, as
+part of the definition of a language-defined package, an Ada construct
+that may be illegal.
+
+****************************************************************
+
+From: 	Pascal Leroy
+Sent: 	Saturday, December 10, 2005  5:33 AM
+
+Good point.  I think we should remove the pragma from the spec of System
+and add a sentence at the end of 13.7(34):
+
+	Address has preelaborable initialization (see 10.2).
+
+In the case where address is private, this means that the pragma must be
+applied to it.  However, if address is, say, a scalar, it has
+preelaborable initialization by fiat.
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent