PROLOG (C only)

Category

Object code control

Pragma equivalent

#pragma prolog (C only)

Purpose

Enables you to provide your own function entry code for all functions that have extern scope, or for all extern and static functions.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-PROLOG--(--+-"text-string"-------------------+--)-----------><
              '-+-EXTERN-+--(--"text-string"--)-'      
                '-ALL----'                             

Defaults

The compiler generates default prolog code for the functions that do not have user-supplied prolog code.

Parameters

text-string

text-string is a C string, which must contain valid HLASM statements.

If the text-string consists of white-space characters only, or if the text-string is not provided, then the compiler ignores the option specification. If the text-string does not contain any white-space characters, then the compiler will insert leading spaces in front. Otherwise, the compiler will insert the text-string into the function prolog location of the generated assembler source. The compiler does not understand or validate the contents of the text-string. In order to satisfy the assembly step later, the given text-string must form valid HLASM code with the surrounding code generated by the compiler.

Note: Special characters like newline and quote are shell (or command line) meta characters, and may be preprocessed before reaching the compiler. It is advisable to avoid using them. The intended use of this option is to specify an assembler macro as the function prolog.

For information on valid HLASM statements, see #pragma prolog.

EXTERN
If the PROLOG option is specified with this suboption or without any suboption, the prolog applies to all functions that have external linkage in the compilation unit.
ALL
If the PROLOG option is specified with this suboption, the prolog also applies to static functions defined in the compilation unit.

Usage

For more information on METAL C default prolog code, see z/OS Metal C Programming Guide and Reference.

Notes:
  1. The PROLOG option is only valid when the METAL option is specified.
  2. When the PROLOG option is specified multiple times with the same suboption all or extern, only the function entry code of the last suboption specified will be displayed.
  3. The PROLOG option with the suboption all overwrites the one with extern suboption, or the one without any suboption.

IPA effects

See section Building Metal C programs with IPA in z/OS Metal C Programming Guide and Reference.

Predefined macros

None.

Related information

For more information on the METAL compiler option, see METAL | NOMETAL (C only).

See EPILOG (C only) for information on providing function exit code for system development.