pragma Suppress (Identifier [, [On =>] Name]);
This is a standard pragma, and supports all the check names required in the RM. It is included here because GNAT recognizes some additional check names that are implementation defined (as permitted by the RM):
Alignment_Checkcan be used to suppress alignment checks on addresses used in address clauses. Such checks can also be suppressed by suppressing range checks, but the specific use of
Alignment_Checkallows suppression of alignment checks without suppressing other range checks. Note that
Alignment_Checkis suppressed by default on machines (such as the x86) with non-strict alignment.
Atomic_Synchronizationcan be used to suppress the special memory synchronization instructions that are normally generated for access to
Atomicvariables to ensure correct synchronization between tasks that use such variables for synchronization purposes.
Duplicated_Tag_CheckCan be used to suppress the check that is generated for a duplicated tag value when a tagged type is declared.
Container_ChecksCan be used to suppress all checks within Ada.Containers and instances of its children, including Tampering_Check.
Tampering_CheckCan be used to suppress tampering check in the containers.
Predicate_Checkcan be used to control whether predicate checks are active. It is applicable only to predicates for which the policy is
Assertion_Policy, which determines if a given predicate is ignored or checked for the whole program, the use of
Unsuppresswith this check name allows a given predicate to be turned on and off at specific points in the program.
Validity_Checkcan be used specifically to control validity checks. If
Suppressis used to suppress validity checks, then no validity checks are performed, including those specified by the appropriate compiler switch or the
Check_Namepragma are also allowed.
Note that pragma Suppress gives the compiler permission to omit checks, but does not require the compiler to omit checks. The compiler will generate checks if they are essentially free, even when they are suppressed. In particular, if the compiler can prove that a certain check will necessarily fail, it will generate code to do an unconditional ’raise’, even if checks are suppressed. The compiler warns in this case.
Of course, run-time checks are omitted whenever the compiler can prove that they will not fail, whether or not checks are suppressed.