Next: , Previous: Pragma No_Return, Up: Implementation Defined Pragmas


Pragma Normalize_Scalars

Syntax:

     pragma Normalize_Scalars;

This is a language defined pragma which is fully implemented in GNAT. The effect is to cause all scalar objects that are not otherwise initialized to be initialized. The initial values are implementation dependent and are as follows:

Standard.Character
Objects whose root type is Standard.Character are initialized to Character'Last. This will be out of range of the subtype only if the subtype range excludes this value.
Standard.Wide_Character
Objects whose root type is Standard.Wide_Character are initialized to Wide_Character'Last. This will be out of range of the subtype only if the subtype range excludes this value.
Integer types
Objects of an integer type are initialized to base_type'First, where base_type is the base type of the object type. This will be out of range of the subtype only if the subtype range excludes this value. For example, if you declare the subtype:
          subtype Ityp is integer range 1 .. 10;
     

then objects of type x will be initialized to Integer'First, a negative number that is certainly outside the range of subtype Ityp.

Real types
Objects of all real types (fixed and floating) are initialized to base_type'First, where base_Type is the base type of the object type. This will be out of range of the subtype only if the subtype range excludes this value.
Modular types
Objects of a modular type are initialized to typ'Last. This will be out of range of the subtype only if the subtype excludes this value.
Enumeration types
Objects of an enumeration type are initialized to all one-bits, i.e. to the value 2 ** typ'Size - 1. This will be out of range of the enumeration subtype in all cases except where the subtype contains exactly 2**8, 2**16, or 2**32 elements.