Commit a3a95769 by Robert Dewar Committed by Arnaud Charlet

a-except.adb (Exception_Identity): return Null_Id for null occurrence instead of…

a-except.adb (Exception_Identity): return Null_Id for null occurrence instead of raising CE (AI-241) Add warnings...

2005-06-14  Robert Dewar  <dewar@adacore.com>

	* a-except.adb (Exception_Identity): return Null_Id for null occurrence
	instead of raising CE (AI-241)
	Add warnings off to allow categorization violations for AI-362

From-SVN: r101021
parent 99b97b2e
...@@ -664,15 +664,18 @@ package body Ada.Exceptions is ...@@ -664,15 +664,18 @@ package body Ada.Exceptions is
------------------------ ------------------------
function Exception_Identity function Exception_Identity
(X : Exception_Occurrence) (X : Exception_Occurrence) return Exception_Id
return Exception_Id
is is
begin begin
if X.Id = Null_Id then -- Note that the following test used to be here for the original
raise Constraint_Error; -- Ada 95 semantics, but these were modified by AI-241 to require
else -- returning Null_Id instead of raising Constraint_Error.
return X.Id;
end if; -- if X.Id = Null_Id then
-- raise Constraint_Error;
-- end if;
return X.Id;
end Exception_Identity; end Exception_Identity;
--------------------------- ---------------------------
...@@ -1259,12 +1262,8 @@ package body Ada.Exceptions is ...@@ -1259,12 +1262,8 @@ package body Ada.Exceptions is
Save_Occurrence_No_Private (Target, Source); Save_Occurrence_No_Private (Target, Source);
end Save_Occurrence; end Save_Occurrence;
function Save_Occurrence function Save_Occurrence (Source : Exception_Occurrence) return EOA is
(Source : Exception_Occurrence)
return EOA
is
Target : EOA := new Exception_Occurrence; Target : EOA := new Exception_Occurrence;
begin begin
Save_Occurrence (Target.all, Source); Save_Occurrence (Target.all, Source);
return Target; return Target;
...@@ -1394,6 +1393,11 @@ package body Ada.Exceptions is ...@@ -1394,6 +1393,11 @@ package body Ada.Exceptions is
end ZZZ; end ZZZ;
begin begin
pragma Warnings (Off);
-- Allow calls to non-static subprograms in Ada 2005 mode where this
-- package will be implicitly categorized as Preelaborate. See AI-362 for
-- details. It is safe in the context of the run-time to violate the rules!
-- Allocate the Non-Tasking Machine_State -- Allocate the Non-Tasking Machine_State
Set_Machine_State_Addr_NT (System.Address (Allocate_Machine_State)); Set_Machine_State_Addr_NT (System.Address (Allocate_Machine_State));
...@@ -1403,4 +1407,6 @@ begin ...@@ -1403,4 +1407,6 @@ begin
AAA; AAA;
ZZZ; ZZZ;
pragma Warnings (On);
end Ada.Exceptions; end Ada.Exceptions;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment