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


2.114 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 unless the subtype range excludes NUL (in which case NUL is used). This choice will always generate an invalid value if one exists.
`Standard.Wide_Character'
Objects whose root type is Standard.Wide_Character are initialized to Wide_Character'Last unless the subtype range excludes NUL (in which case NUL is used). This choice will always generate an invalid value if one exists.
`Standard.Wide_Wide_Character'
Objects whose root type is Standard.Wide_Wide_Character are initialized to the invalid value 16#FFFF_FFFF# unless the subtype range excludes NUL (in which case NUL is used). This choice will always generate an invalid value if one exists.
`Integer types'
Objects of an integer type are treated differently depending on whether negative values are present in the subtype. If no negative values are present, then all one bits is used as the initial value except in the special case where zero is excluded from the subtype, in which case all zero bits are used. This choice will always generate an invalid value if one exists.

For subtypes with negative values present, the largest negative number is used, except in the unusual case where this largest negative number is in the subtype, and the largest positive number is not, in which case the largest positive value is used. This choice will always generate an invalid value if one exists.

`Floating-Point Types'
Objects of all floating-point types are initialized to all 1-bits. For standard IEEE format, this corresponds to a NaN (not a number) which is indeed an invalid value.
`Fixed-Point Types'
Objects of all fixed-point types are treated as described above for integers, with the rules applying to the underlying integer value used to represent the fixed-point value.
`Modular types'
Objects of a modular type are initialized to all one bits, except in the special case where zero is excluded from the subtype, in which case all zero bits are used. This choice will always generate an invalid value if one exists.
`Enumeration types'
Objects of an enumeration type are initialized to all one-bits, i.e., to the value 2 ** typ'Size - 1 unless the subtype excludes the literal whose Pos value is zero, in which case a code of zero is used. This choice will always generate an invalid value if one exists.