CVS difference for arm/source/11.mss

Differences between 1.25 and version 1.26
Log of other versions for file arm/source/11.mss

--- arm/source/11.mss	2000/09/01 03:51:20	1.25
+++ arm/source/11.mss	2004/09/17 04:56:27	1.26
@@ -1,10 +1,10 @@
 @Part(11, Root="ada.mss")
-@Comment{$Date: 2000/09/01 03:51:20 $}
+@Comment{$Date: 2004/09/17 04:56:27 $}
 @Comment{$Source: e:\\cvsroot/ARM/Source/11.mss,v $}
-@Comment{$Revision: 1.25 $}
+@Comment{$Revision: 1.26 $}
 @redundant[This section defines the facilities for dealing with errors or other
@@ -314,7 +314,10 @@
-@Syn{lhs=<raise_statement>,rhs="@key{raise} [@SynI{exception_}@Syn2{name}];"}
+      | @key{raise} @SynI{exception_}@Syn2{name} [@key{with} @SynI{string_}@Syn2{expression}];>,
+Old=<@key{raise} [@SynI{exception_}@Syn2{name}];>}"}
@@ -327,7 +330,14 @@
 but not within a body enclosed by that handler.
+The @nt<expression>, if any, in a @nt<raise_statement>, is expected
+to be of type String.
 @Defn2{Term=[raise], Sec=(an exception)}
 To @i(raise an exception) is to
 raise a new occurrence of that exception@Redundant[,
@@ -335,6 +345,8 @@
 @PDefn2{Term=[execution], Sec=(raise_statement with an exception_name)}
 For the execution of a @nt{raise_statement} with an
 @SynI{exception_}@nt{name}, the named exception is raised.
+@Chg{Version=[2],New=[@redundant{If a @SynI<string_>@nt<expression> is present, a call of
+Ada.Exceptions.Exception_Message returns that string.}],Old=[]}
 @PDefn2{Term=[execution], Sec=(re-raise statement)}
 For the execution of a re-raise statement,
 the exception occurrence that caused transfer of control to the
@@ -345,6 +357,13 @@
 Exception_Occurrence value.
 This allows the original cause of the exception to be determined.
+@Chg{Version=[2],New=[The definition of Ada.Exceptions.Exception_Message
+includes a statement that the string is returned (see
+@RefSecNum{The Package Exceptions}). We repeat it here so that we don't have
+an unexplained parameter in this subclause.],Old=[]}
@@ -366,6 +385,15 @@
 any force.
+@Chg{Version=[2],New=[@Defn{extensions to Ada 95}The syntax of a
+@nt{raise_statement} is extended to include a string message. This is more
+convinient than calling Ada.Exceptions.Exception_Message
+(@SynI{exception_}@Syn2{name}'Identity, @SynI{string_}@Syn2{expression}); and
+should encourage the use of message strings when raising exceptions.],Old=[]}
 @LabeledClause{Exception Handling}
@@ -526,18 +554,25 @@
 @leading@keepnext@;The following language-defined library package exists:
-@key[package] Ada.Exceptions @key[is]
-    @key[type] @AdaTypeDefn{Exception_Id} @key[is] @key[private];
+@key[package] Ada.Exceptions @key[is]@Chg{Version=[2],New=[
+    @key[pragma] Preelaborate(Exceptions);],Old=[]}
+    @key[type] @AdaTypeDefn{Exception_Id} @key[is] @key[private];@Chg{Version=[2],New=[
+    @key[pragma] Preelaboratable_Initialization(Exception_Id);],Old=[]}
     @AdaDefn{Null_Id} : @key[constant] Exception_Id;
     @key[function] @AdaSubDefn{Exception_Name}(Id : Exception_Id) @key[return] String;
-    @key[type] @AdaTypeDefn{Exception_Occurrence} @key[is] @key[limited] @key[private];
+    @key[type] @AdaTypeDefn{Exception_Occurrence} @key[is] @key[limited] @key[private];@Chg{Version=[2],New=[
+    @key[pragma] Preelaboratable_Initialization(Exception_Occurrence);],Old=[]}
     @key[type] @AdaTypeDefn{Exception_Occurrence_Access} @key[is] @key[access] @key[all] Exception_Occurrence;
     @AdaDefn{Null_Occurrence} : @key[constant] Exception_Occurrence;
     @key[procedure] @AdaSubDefn{Raise_Exception}(E : @key[in] Exception_Id;
-                              Message : @key[in] String := "");
+                              Message : @key[in] String := "");@Chg{Version=[2],New=[
+    @key[pragma] No_Return(Raise_Exception);],Old=[]}
     @key[function] @AdaSubDefn{Exception_Message}(X : Exception_Occurrence) @key[return] String;
     @key[procedure] @AdaSubDefn{Reraise_Occurrence}(X : @key[in] Exception_Occurrence);
@@ -583,12 +618,18 @@
 Raise_Exception raises a new occurrence of the identified exception.
 In this case, Exception_Message returns the Message parameter of
-For a @nt{raise_statement} with an @i{exception_}@nt{name},
+@Chg{Version=[2],New=[For a @nt{raise_statement} with an @i{exception_}@nt{name}
+and a @SynI{string_}@nt{expression}, Exception_Message returns that string.],Old=[]}
+For a @nt{raise_statement} with an @i{exception_}@nt{name}@Chg{Version=[2],New=[ but
+without a @SynI{string_}@nt{expression}],Old=[]},
 Exception_Message returns implementation-defined information
 about the exception occurrence.
+@Chg{Version=[2],New=[In either case, Exception_Message returns a string with
+lower bound 1.],Old=[]}
 Reraise_Occurrence reraises the specified exception occurrence.
 @ImplDef{The information returned by Exception_Message.}
@@ -627,9 +668,10 @@
 Exception_Identity returns the identity of the exception of the
 The Exception_Name functions return the full expanded name of the
-exception, in upper case,
-starting with a root library unit.
+exception, in upper case, starting with a root library unit.
+@Chg{Version=[2],New=[The returned string has lower bound 1.],Old=[]}
 For an exception declared immediately within package Standard,
 the @nt{defining_@!identifier} is returned.
 The result is implementation defined if the exception is declared within
@@ -648,17 +690,43 @@
 not the name of the occurrence.
 Exception_Information returns implementation-defined information
 about the exception occurrence.
+@Chg{Version=[2],New=[The returned string has lower bound 1.],Old=[]}
 @ImplDef{The information returned by Exception_Information.}
-Raise_Exception and Reraise_Occurrence have no effect in the case of
-Null_Id or Null_Occurrence.
+@Chg{Version=[2],New=[],Old=[Raise_Exception and ]}Reraise_Occurrence
+@Chg{Version=[2],New=[has],Old=[have]} no effect in the case of
+@Chg{Version=[2],New=[],Old=[Null_Id or ]}Null_Occurrence.
 @Defn2{Term=[Constraint_Error],Sec=(raised by failure of run-time check)}
-Exception_Message, Exception_Identity, Exception_Name, and
+@Chg{Version=[2],New=[Raise_Exception and Exception_Name raise Constraint_Error
+for a Null_Id. Exception_Message, Exception_Name, and Exception_Information
+raise Constraint_Error for a Null_Occurrence. Exception_Identity applied
+to Null_Occurrence returns Null_Id.],
+Old=[Exception_Message, Exception_Identity, Exception_Name, and
-raise Constraint_Error for a Null_Id or Null_Occurrence.
+raise Constraint_Error for a Null_Id or Null_Occurrence.]}
+@Chg{Version=[2],New=[Null_Occurrence can be tested for by comparing
+Exception_Identity(Occurrence) to Null_Id.],Old=[]}
+@Chg{Version=[2],New=[Raise_Exception was changed so that it always raises
+an exception and thus is a No_Return procedure. A similar change was not
+made for Reraise_Occurrence, as doing so was determined to be a significant
+incompatibility. It is not unusual to pass an Exception_Occurrence to other
+code to delay raising it. If there was no exception, passing Null_Occurrence
+works fine (nothing is raised). Moreover, as there is no test for
+Null_Occurrence in Ada 95, this is the only way to write such code without
+using additional flags. Breaking this sort of code is unacceptable.],Old=[]}
 The Save_Occurrence procedure copies the Source to the Target.
 The Save_Occurrence function uses an @nt{allocator} of type
 Exception_Occurrence_Access to create a new object,
@@ -893,6 +961,201 @@
+@Chg{Version=[2],New=[@Defn{inconsistencies with Ada 95}
+Exception_Identity of an Exception_Occurrence now is
+defined to return Null_Id for Null_Occurrence, rather than raising
+Constraint_Error. This provides a simple way to test for Null_Occurrence.
+We expect that programs that need Constraint_Error raised will be very rare;
+they can be easily fixed by explicitly testing for Null_Id or by using
+Exception_Name instead.],Old=[]}
+@Chg{Version=[2],New=[@Defn{inconsistencies with Ada 95}
+Raise_Exception now raises Constraint_Error if passed Null_Id. This means
+that it always raises an exception, and thus we can apply pragma No_Return to
+it. We expect that programs that call Raise_Exception with Null_Id will be
+rare, and programs that does that and expect no exception to be raised will be
+rarer; such programs can be easily fixed by explicitly testing for Null_Id
+before calling Raise_Exception.],Old=[]}
+@Chg{Version=[2],New=[@Defn{extensions to Ada 95}
+The package Ada.Exceptions is preelaborated, and types Exception_Id and
+Exception_Occurrence have preelaboratable initialization, allowing this package
+to be used in preelaborated units.],Old=[]}
+@Chg{Version=[2],New=[The meaning of Exception_Message is reworded to reflect
+that the string can come from a @nt{raise_statement} as well as a call of
+@Chg{Version=[2],New=[We now define the lower bound of the string returned from
+Exception_Name, Exception_Message, and Exception_Information. This makes
+working with the returned string easier, and is consistent with many other
+string-returning functions in Ada.],Old=[]}
+@LabeledAddedSubClause{Version=[2],Name=[Pragmas Assert and Assertion_Policy]}
+@Chg{Version=[2],New=[Pragma Assert is used to assert the truth of a boolean
+expression at any point within a sequence of declarations or statements. Pragma
+Assertion_Policy is used to control whether such assertions@Defn{Assertions}
+are to be ignored by the implementation, checked at run-time, or handled in
+some implementation-defined manner.],Old=[]}
+@Chg{Version=[2],New=[@Leading@Keepnext@;The form of a @nt{pragma} Assert is as follows:],Old=[]}
+@Chg{Version=[2],New=<@AddedPragmaSyn`Version=[2],@key{pragma} @prag<Assert>([Check =>] @SynI{Boolean_}@Syn2{expression}[, [Message =>] @SynI{string_}@Syn2{expression}]);'>,Old=<>}
+@Chg{Version=[2],New=[A @nt{pragma} Assert is allowed at the place where a
+@nt{declarative_item} or a @nt{statement} is allowed.],Old=[]}
+@Chg{Version=[2],New=[@Leading@Keepnext@;The form of a @nt{pragma} Assertion_Policy is as follows:],Old=[]}
+@Chg{Version=[2],New=<@AddedPragmaSyn`Version=[2],@key{pragma} @prag<Assertion_Policy>(@SynI{policy_}@Syn2{identifier});'>,Old=<>}
+@Chg{Version=[2],New=[@PDefn2{Term=[configuration pragma], Sec=(Assertion_Policy)}
+@PDefn2{Term=[pragma, configuration], Sec=(Assertion_Policy)}
+A @nt{pragma} Assertion_Policy is a configuration pragma.],Old=[]}
+@Chg{Version=[2],New=[The @SynI<policy_>@nt<identifier> of an Assertion_Policy
+pragma shall be either Check, Ignore, or an implementation-defined identifier.],Old=[]}
+@SynI<policy_>@nt<identifier>s allowed in a @nt{pragma} Assertion_Policy.],Old=[]}]}
+@Chg{Version=[2],New=[A @nt<pragma> Assertion_Policy is a configuration pragma
+that specifies the assertion policy in effect for the compilation units to which it
+applies. Different policies may apply to different compilation
+units within the same partition. The default assertion policy is
+@ChgImplDef{Version=[2],Kind=[Added],Text=[@Chg{Version=[2],New=[The default
+assertion policy.],Old=[]}]}
+@Chg{Version=[2],New=[@leading@keepnext@;The following language-defined library package exists:],Old=[]}
+@key[package] Ada.Assertions @key[is]
+   @key[pragma] Pure(Assertions);],Old=[]}
+@Chg{Version=[2],New=[   Assertion_Error : @key<exception>;],Old=[]}
+@Chg{Version=[2],New=[   @key<procedure> Assert(Check : @key<in> Boolean);
+   @key<procedure> Assert(Check : @key<in> Boolean; Message : @key<in> String);],Old=[]}
+@Chg{Version=[2],New=[@key<end> Ada.Assertions;],Old=[]}
+@Chg{Version=[2],New=[A compilation unit containing a @nt{pragma} Assert has a
+semantic dependence on the Ada.Assertions library unit.],Old=[]}
+@Chg{Version=[2],New=[The assertion policy that applies within an instance is
+the policy that applies within the generic unit.],Old=[]}
+@Chg{Version=[2],New=[An assertion policy @defn{assertion policy}specifies how a @nt{pragma} Assert
+is interpreted by the implementation. If the assertion policy is Ignore at the
+point of a pragma Assert, the pragma is ignored. If the assertion policy is
+Check at the point of a @nt{pragma} Assert, the elaboration of the pragma
+consists of evaluating the boolean expression, and if it evaluates to False,
+evaluating the Message string, if any, and raising the exception
+Ada.Assertions.Assertion_Error, with a message if the Message argument is
+@Chg{Version=[2],New=[@leading@keepnext@;Calling the procedure Ada.Assertions.Assert without a Message parameter is
+equivalent to:],Old=[]}
+@Chg{Version=[2],New=[@key<if> Check = False @key<then>
+   @key<raise> Ada.Assertions.Assertion_Error;
+@key{end} @key{if};],Old=[]}
+@Chg{Version=[2],New=[@leading@keepnext@;Calling the procedure
+Ada.Assertions.Assert with a Message parameter is equivalent to:],Old=[]}
+@Chg{Version=[2],New=[@key<if> Check = False @key<then>
+   @key<raise> Ada.Assertions.Assertion_Error @key<with> Message;
+@key{end} @key{if};],Old=[]}
+@Chg{Version=[2],New=[The procedures Assertions.Assert have these effects independent of the
+assertion policy in effect.],Old=[]}
+@Chg{Version=[2],New=[Assertion_Error may be declared by renaming an
+implementation-defined exception from another package.],Old=[]}
+@Chg{Version=[2],New=[This permission is intended to allow implementations
+which had an implementation-defined Assert pragma to continue to use their
+originally defined exception. Without this permission, such an implementation
+would be incorrect, as Exception_Name would return the wrong name.],Old=[]}
+@Chg{Version=[2],New=[Normally, the boolean expression in an Assert pragma
+should not call functions that have significant side-effects when the result of
+the expression is True, so that the particular assertion policy in effect will
+not affect normal operation of the program.],Old=[]}
+@Chg{Version=[2],New=[@Defn{extensions to Ada 95}
+Pragmas Assert and Assertion_Policy, and package Ada.Assertions are new.],Old=[]}
 @LabeledSubClause{Example of Exception Handling}
@@ -983,8 +1246,12 @@
 @LabeledClause{Suppressing Checks}
+@Chg{Version=[2],New=[@i{Checking pragmas}@Defn{Checking pragmas} give
+instructions to an implementation on handling language-defined checks.],Old=[]}
 A @nt{pragma} Suppress gives permission to an
-implementation to omit certain language-defined checks.
+implementation to omit certain language-defined checks@Chg{Version=[2],
+New=[, while a @nt<pragma> Unsuppress revokes the permission to omit checks.],Old=[]}.
 @Defn{language-defined check}
 @Defn2{Term=[check], Sec=(language-defined)}
@@ -1006,35 +1273,60 @@
-@Leading@Keepnext@;The form of a @nt{pragma} Suppress is as follows:
+@Leading@Keepnext@;The form@Chg{Version=[2],New=[s of checking pragmas are],Old=[ of a @nt{pragma} Suppress is]} as follows:
-@PragmaSyn`@key{pragma} @prag(Suppress)(@Syn2{identifier} [, [On =>] @Syn2{name}]);'
+@PragmaSyn`@key{pragma} @prag(Suppress)(@Syn2{identifier}@Chg{Version=[2],New=<>,Old=( [, [On =>] @Syn2{name}])});'
+@Chg{Version=[2],New=<@AddedPragmaSyn`Version=[2],@key{pragma} @prag(Unsuppress)(@Syn2{identifier});'>,Old=<>}
 @PDefn2{Term=[configuration pragma], Sec=(Suppress)}
 @PDefn2{Term=[pragma, configuration], Sec=(Suppress)}
-A @nt{pragma} Suppress is allowed only immediately within a
+A @Chg{Version=[2],New=<checking pragma>,Old=<@nt{pragma} Suppress>} is
+allowed only immediately within a
 @nt{declarative_part}, immediately within a @nt{package_@!specification},
 or as a configuration pragma.
 The @nt{identifier} shall be the name of a check.
-The @nt{name} (if present) shall statically denote
-some entity.
+@Chg{Version=[2],New=<>,Old=<The @nt{name} (if present) shall statically denote
+some entity.>}
-For a @nt{pragma} Suppress that is immediately within a
-and includes a @nt<name>, the @nt<name> shall denote
-an entity (or several overloaded subprograms) declared immediately
-within the @nt{package_specification}.
+@Chg{Version=[2],New=<>,Old=<For a @nt{pragma} Suppress that is immediately
+within a @nt{package_specification} and includes a @nt<name>, the @nt<name>
+shall denote an entity (or several overloaded subprograms) declared immediately
+within the @nt{package_specification}.>}
+@Chg{Version=[2],New=[A checking pragma applies to the named check in a specific region (see below),
+and applies to all entities in that region. A checking pragma given in a
+@nt<declarative_part> or immediately within a @nt<package_specification>
+applies from the place of the @nt<pragma> to the end of the innermost enclosing
+declarative region. The region for a checking pragma given as a configuration
+pragma is the declarative region for the entire compilation unit (or units) to
+which it applies.],Old=[]}
+@Chg{Version=[2],New=[If a checking pragma applies to a generic instantiation, then the checking
+pragma also applies to the instance. If a checking pragma applies to a call to
+a subprogram that has a @nt<pragma> Inline applied to it, then the checking
+pragma also applies to the inlined subprogram body.],Old=[]}
 A @nt{pragma} Suppress gives permission to an implementation to omit the
-named check from the place of the @nt{pragma} to the end of the
+named check @Chg{Version=[2],New=[(or every check in the case of All_Checks) for any entities to which it
+applies.],Old=[from the place of the @nt{pragma} to the end of the
 innermost enclosing declarative region, or,
 if the @nt{pragma} is given in a @nt{package_@!specification}
 and includes a @nt<name>,
@@ -1042,7 +1334,7 @@
 If the @nt{pragma} includes a @nt{name},
 the permission applies only to checks performed on the named entity,
 or, for a subtype, on objects and values of its type.
-Otherwise, the permission applies to all entities.
+Otherwise, the permission applies to all entities.]}
 @Defn{suppressed check}
 If permission has been given to suppress a given check,
 the check is said to be @i{suppressed}.
@@ -1054,22 +1346,34 @@
 for example, if the erroneousness is detected.
+@Chg{Version=[2],New=[A @nt{pragma} Unsuppress revokes the permission to omit
+the named check (or every check in the case of All_Checks) given by any
+@nt{pragma} Suppress that applies at the point of the @nt{pragma} Unsuppress.
+The permission is revoked for the region to which the @nt{pragma} Unsuppress
+applies. If there is no such permission at the point of a @nt{pragma}
+Unsuppress, then the @nt{pragma} has no effect. A later @nt{pragma} Suppress
+can renew the permission.],Old=[]}
 @Leading@Keepnext@;The following are the language-defined checks:
 @Defn2{Term=[Constraint_Error],Sec=(raised by failure of run-time check)}
 @Leading@Redundant[The following checks correspond to situations in which the
 exception Constraint_Error is raised upon failure.]
 Access_Check @\@Redundant[When evaluating a dereference (explicit
 or implicit),
 check that the value of the @nt{name} is not @key{null}.
-When passing an actual parameter to a formal access parameter,
+@Chg{Version=[2],New=[When converting to a null-excluding subtype,
+check that the converted value is not @key{null}.],
+Old=[When passing an actual parameter to a formal access parameter,
 check that the value of the actual parameter is not @key{null}.
-@Chg{New=[When evaluating a @nt{discriminant_association} for an access
-discriminant, check that the value of the discriminant is not @key{null}.],
+@Chg{Version=[1],New=[When evaluating a @nt{discriminant_association} for an
+access discriminant, check that the value of the discriminant is not @key{null}.],
 Discriminant_Check @\@Redundant[Check that the discriminants of a
@@ -1184,8 +1488,11 @@
 An implementation is allowed to place restrictions on
-Suppress @nt<pragma>s.
+@Chg{Version=[2],New=[checking pragmas, subject only to the requirement that
+@nt{pragma} Unsuppress shall allow any
+check names supported by @nt{pragma} Suppress],Old=[Suppress @nt<pragma>s]}.
 An implementation is allowed to add additional check names,
 with implementation-defined semantics.
@@ -1209,6 +1516,14 @@
 implementation will suppress any Range_Checks that are implemented in
 the same manner as Overflow_Checks (unless they are free).
+@Chg{Version=[2],New=[An implementation may support an additional parameter on
+@nt{pragma} Unsuppress similar to the one allowed for @nt{pragma} Suppress
+(see @RefSecNum{Specific Suppression of Checks}). The meaning of
+such a parameter is implementation-defined.],Old=[]}
+@ChgImplDef{Version=[2],Kind=[Added],Text=[@Chg{Version=[2],New=[Existence and
+meaning of second parameter of @nt{pragma} Unsuppress.],Old=[]}]}
@@ -1230,13 +1545,22 @@
 There is no guarantee that a suppressed check is actually removed;
 hence a @nt{pragma} Suppress should be used only for efficiency reasons.
+@Chg{Version=[2],New=[It is possible to give both a @nt{pragma} Suppress and
+Unsuppress for the same check immediately within the same @nt{declarative_part}.
+In that case, the last @nt{pragma} given determines whether or not the check is
+suppressed. Similarly, it is possible to resuppress a check which has been
+unsuppressed by giving a pragma Suppress in an inner declarative region.],Old=[]}
 @Leading@Keepnext@i{Examples of suppressing checks:}
-@key[pragma] Suppress(Range_Check);
-@key[pragma] Suppress(Index_Check, On => Table);
+@key[pragma] Suppress(@Chg{Version=[2],New=[Index_Check);
+@key[pragma] Unsuppress(Overflow_Check);],Old=[Range_Check);
+@key[pragma] Suppress(Index_Check, On => Table);]}
@@ -1285,6 +1609,31 @@
 as well as the new @nt{explicit_dereference},
 which was included in @nt{selected_component} in RM83.
+@Chg{Version=[2],New=[@Defn{extensions to Ada 95}Pragma Unsuppress is new.],
+@Chg{Version=[2],New=[The description of Access_Check was corrected by the
+Corrigendum to include the discriminant case. This change was then replaced
+by the more general notion of checking conversions to null-excluding subtypes
+in the Amendment.],Old=[]}
+@Chg{Version=[2],New=[The On parameter of pragma Suppress was moved to Annex J.
+This feature's effect is inherently non-portable, depending on the
+implementation's model of computation. Compiler surveys demonstrated this,
+showing that implementations vary widely in the interprestation of these
+parameters, even on the same target. While this is relatively harmless for
+Suppress (which is never required to do anything), it would be a significant
+problem for Unsuppress (we want the checks to be made for all implementations).
+By moving it, we avoid needing to define the meaning of Unsuppress with an
+On parameter.],Old=[]}
 @LabeledClause{Exceptions and Optimization}

Questions? Ask the ACAA Technical Agent