Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help


11.5 Suppressing Checks

(1)
A pragma Suppress gives permission to an implementation to omit certain language-defined checks.
(2)
A language-defined check (or simply, a ``check'') is one of the situations defined by this International Standard that requires a check to be made at run time to determine whether some condition is true. A check fails when the condition being checked is false, causing an exception to be raised.
Syntax
(3)
(4)
         pragma Suppress(identifier [, [On =>] name]);
(5)
Legality Rules
(6)
The identifier shall be the name of a check. The name (if present) shall statically denote some entity.
(7)
For a pragma Suppress that is immediately within a package_specification and includes a name, the name shall denote an entity (or several overloaded subprograms) declared immediately within the package_specification.
Static Semantics
(8)
A pragma Suppress gives permission to an implementation to omit the named check from the place of the pragma to the end of the innermost enclosing declarative region, or, if the pragma is given in a package_specification and includes a name, to the end of the scope of the named entity. If the pragma includes a name, the permission applies only to checks performed on the named entity, or, for a subtype, on objects and values of its type. Otherwise, the permission applies to all entities. If permission has been given to suppress a given check, the check is said to be suppressed.
(9)
The following are the language-defined checks:
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
(22)
(23)
(24)
(25)
Erroneous Execution
(26)
If a given check has been suppressed, and the corresponding error situation occurs, the execution of the program is erroneous.
Implementation Permissions
(27)
An implementation is allowed to place restrictions on Suppress pragmas. An implementation is allowed to add additional check names, with implementation-defined semantics. When Overflow_Check has been suppressed, an implementation may also suppress an unspecified subset of the Range_Checks.
Implementation Advice
(28)
The implementation should minimize the code executed for checks that have been suppressed.

(29)
Examples
(30)
Examples of suppressing checks:
(31)
       pragma Suppress(Range_Check);
       pragma Suppress(Index_Check, On => Table);


Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help

Ada WWW Home -- Email comments, additions, corrections, gripes, kudos, etc. to:

Magnus Kempe -- Magnus.Kempe@di.epfl.ch
Copyright statement
Page last generated: 95-03-12