INITAUTO | NOINITAUTO

Category

Error checking and debugging

Pragma equivalent

None.

Purpose

Initializes automatic variables to a specific value for debugging purposes.

When the INITAUTO compiler option is in effect, the option instructs the compiler to generate extra code to initialize these variables with a user-defined value. This reduces the runtime performance of the program and should only be used for debugging.

When the NOINITAUTO compiler option is in effect, automatic variables without initializers are not implicitly initialized.

Syntax

Read syntax diagramSkip visual syntax diagramNOINITAINITA(nnnnnnnn, WORD)

Defaults

NOINITAUTO

Parameters

nnnnnnnn
The hexadecimal value you specify for nnnnnnnn represents the initial value for automatic storage in bytes. It can be two to eight hexadecimal digits in length. There is no default for this value.
WORD
The suboption WORD is optional, and can be abbreviated to W. If you specify WORD , nnnnnnnnn is a word initializer; otherwise it is a byte initializer. Only one initializer can be in effect for the compilation. If you specify INITAUTO more than once, the compiler uses the last setting.
Note: The word initializer is useful in checking uninitialized pointers.

Usage

Automatic variables require storage only while the block in which they are declared is active. See The auto storage class specifier in z/OS XL C/C++ Language Reference for more information.

If you specify a byte initializer, and specify more than 2 digits for nnnnnnnn, the compiler uses the last 2 digits.

If you specify a word initializer, the compiler uses the last 2 digits to initialize a byte, and all digits to initialize a word.

The usage status of this option is inserted in the object file to aid you in diagnosing a problem with your program.

IPA effects

The IPA compile step generates information for the IPA link step. The INITAUTO option also affects the regular object module if you request one by specifying the IPA(OBJECT) option.

If you do not specify the INITAUTO option in the IPA link step, the setting in the IPA compile step will be used. The IPA link step merges and optimizes the application’s code, and then divides it into sections for code generation. Each of these sections is a partition. The IPA link step uses information from the IPA compile step to determine if a subprogram can be placed in a particular partition. Only compatible subprograms are included in a given partition. Compatible subprograms have the same INITAUTO setting.

The IPA link step sets the INITAUTO setting for a partition to the specification of the first subprogram that is placed in the partition. It places subprograms that follow in partitions that have the same INITAUTO setting.

You can override the setting of INITAUTO by specifying the option on the IPA link step. If you do so, all partitions will use that value, and the Prolog section of the IPA link step listing will display the value.

The Partition Map sections of the IPA link step listing and the object module display the value of the INITAUTO option.

Predefined macros

  • __INITAUTO__ is defined to the hexadecimal constant (0xnnU), including the parentheses, when the INITAUTO compiler option is in effect. Otherwise, it is not defined.
  • __INITAUTO_W__ is defined to the hexadecimal constant (0xnnnnnnnnU), including the parentheses, when the INITAUTO compiler option is in effect. Otherwise, it is not defined.