Restrictions in Stand-alone Libraries (GNAT User’s Guide for Native Platforms)

#### 3.9.3.4 Restrictions in Stand-alone Libraries ¶

You should use the pragmas listed below with caution inside libraries, since they can create incompatibilities with other Ada libraries:

- pragma `Locking_Policy`
- pragma `Partition_Elaboration_Policy`
- pragma `Queuing_Policy`
- pragma `Task_Dispatching_Policy`
- pragma `Unreserve_All_Interrupts`

When using a library that contains such pragmas, the user of the library must ensure that all libraries use the same pragmas with the same values. Otherwise, `Program_Error` will be raised during the elaboration of the conflicting libraries. You should document the usage of these pragmas and its consequences for the user.

Similarly, the traceback in the exception occurrence mechanism should be enabled or disabled in a consistent manner across all libraries. Otherwise, `Program_Error` will be raised during the elaboration of the conflicting libraries.

If you use the `Version` or `Body_Version` attributes inside a library, you need to perform a `gnatbind` step that specifies all `ALI` files in all libraries so that version identifiers can be properly computed. In practice these attributes are rarely used, so this is unlikely to be a consideration.