Appendix B. Restrictions and Profiles

This Appendix defines how the Ada 95 restrictions, accessible through the pragma Restrictions, are supported. Unsafe features such as run-time dispatching and heap management are not supported in the run-time system, so all the restrictions that are relevant for these features are set to True by default.

The following restrictions are built in. That is, they cannot be turned off and are exploited by the compiler to offer better-quality generated code than would otherwise be possible.

The implementation-defined pragma Profile may also be used to set and unset restrictions that correspond to a certain application area. The profiles supported are as follows:

Table B-1. Supported Profiles

Profile NameDescription
XGCThis is the default profile and offers the least restrictions.
RavenscarThis allows a limited form of tasking that includes static tasks, protected objects, the delay until statement and interrupts.
Restricted_Run_TimeThis severely restricts the use of non-deterministic language features (including tasking) and is suitable for general avionics applications.
No_Run_TimeThis profile prohibits all calls to the predefined Ada library and is useful for safety-critical applications. Calls to the compiler support library are not restricted.

Table B-2 gives the individual restrictions for each profile. Note that the built-in restrictions apply to all profiles.

Table B-2. Profiles and Restrictions

RestrictionAda 95 Reference Manual SectionDefaultRavenscarRestricted_ Run_Time
Boolean_Entry_BarriersXGC (Ravenscar)FalseTrueTrue
Immediate_ReclamationRM H.4(10)FalseFalseFalse
No_Abort_StatementsRM D.7(5), H.4(3)TrueTrueTrue
No_Access_SubprogramsRM H.4(17)FalseTrueTrue
No_AllocatorsRM H.4(7)FalseFalseTrue
No_Asynchronous_ControlRM D.9(10)FalseTrueTrue
No_CalendarXGCFalseTrueTrue
No_DelayRM H.4(21)FalseFalseTrue
No_DispatchRM H.4(19)TrueTrueTrue
No_Dynamic_InterruptsXGCTrueTrueTrue
No_Dynamic_PrioritiesRM D.9(9)FalseTrueTrue
No_Elaboration_CodeXGCFalseFalseTrue
No_Entry_Calls_In_Elaboration_CodeXGCFalseTrueTrue
No_Entry_QueueXGCTrueTrueTrue
No_Enumeration_MapsXGCFalseFalseTrue
No_Exception_HandlersXGCFalseFalseTrue
No_ExceptionsRM H.4(12)FalseFalseFalse
No_Fixed_PointRM H.4(15)FalseFalseFalse
No_Floating_PointRM H.4(14)FalseFalseFalse
No_Implementation_AttributesXGCFalseFalseTrue
No_Implementation_PragmasXGCFalseFalseTrue
No_Implementation_RestrictionsXGCFalseFalseTrue
No_Implicit_ConditionalsXGCFalseFalseTrue
No_Implicit_Heap_AllocationsRM D.8(8), H.4(3)FalseTrueTrue
No_Implicit_LoopsXGCFalseFalseFalse
No_IORM H.4(20)FalseTrueTrue
No_Local_AllocatorsRM H.4(8)FalseTrueTrue
No_Local_Protected_ObjectsXGCTrueTrueTrue
No_Nested_FinalizationRM D.7(4)TrueTrueTrue
No_Protected_Type_AllocatorsXGCTrueTrueTrue
No_Protected_TypesRM H.4(5)FalseFalseTrue
No_RecursionRM H.4(22)FalseTrueTrue
No_ReentrancyRM H.4(23)FalseFalseFalse
No_Relative_DelayXGCFalseTrueTrue
No_RequeueXGCTrueTrueTrue
No_Select_StatementsXGC (Ravenscar)FalseTrueTrue
No_Standard_Storage_PoolsXGCTrueTrueTrue
No_StreamsXGCTrueTrueTrue
No_Task_AllocatorsRM D.7(7)FalseTrueTrue
No_Task_AttributesXGCTrueTrueTrue
No_Task_HierarchyRM D.7(3), H.4(3)TrueTrueTrue
No_Task_TerminationXGCTrueTrueTrue
No_Terminate_AlternativesRM D.7(6)TrueTrueTrue
No_Unchecked_AccessRM H.4(18)FalseTrueTrue
No_Unchecked_ConversionRM H.4(16)FalseFalseTrue
No_Unchecked_DeallocationRM H.4(9)TrueTrueTrue
No_Wide_CharactersXGCFalseTrueTrue
Static_PrioritiesXGCFalseTrueTrue
Static_Storage_SizeXGCFalseTrueTrue

Table B-3 gives the restrictions concerning numerical limits.

Table B-3. Profiles and Numerical Restrictions

RestrictionAda 95 Reference Manual SectionDefaultRavenscarRestricted_ Run_Time
Max_Asynchronous_Select_NestingRM D.7(18), H.4(2)000
Max_Protected_EntriesRM D.7(14)111
Max_Select_AlternativesRM D.7(12)Undefined00
Max_Storage_At_BlockingRM D.7(17)000
Max_Task_EntriesRM D.7(13), H.4(2)Undefined00
Max_TasksRM D.7(19), H.4(2)UndefinedUndefinedUndefined
Max_Entry_Queue_DepthRavenscar specific111

Violation of the restriction Max_Entry_Queue_Depth is detected at run time and raises the predefined exception Program_Error.