Mixing Elaboration Models (GNAT User’s Guide for Native Platforms)

### 9.6 Mixing Elaboration Models ¶

You can mix units compiled with different elaboration models. However you must observe the following rules:

- A client unit compiled with the dynamic model can only ‘with’ a server unit that meets at least one of the following criteria:
  - The server unit is compiled with the dynamic model.
  - The server unit is a GNAT implementation unit from the `Ada`, `GNAT`, `Interfaces`, or `System` hierarchies.
  - The server unit has pragma `Pure` or `Preelaborate`.
  - The client unit has an explicit `Elaborate_All` pragma for the server unit.

These rules ensure that elaboration checks are not omitted. If the rules are violated, the binder emits a warning:

>     warning: "x.ads" has dynamic elaboration checks and with's
>     warning:   "y.ads" which has static elaboration checks

You can suppress these warnings by specifying binder switch `-ws`.