RENT | NORENT (C only)

Category

Object code control

Pragma equivalent

#pragma options (rent) (C only), #pragma options (norent) (C only)

#pragma variable(rent), #pragma variable(norent)

Purpose

Generates reentrant code.

When the RENT compiler option is in effect, the compiler takes code that is not naturally reentrant and make it reentrant. Refer to z/OS Language Environment Programming Guide for a detailed description of reentrancy.

When the NORENT compiler option is in effect, the compiler does not generate reentrant code from non-reentrant code. Any naturally reentrant code remains reentrant.

Syntax

Read syntax diagramSkip visual syntax diagramNORENTRENT

Defaults

NORENT for C and RENT for C++.

For the z/OS® UNIX System Services utilities, the default for a regular compile is RENT.

Usage

If you use the RENT option, the linkage editor cannot directly process the object module that is produced. You must use either the binder, which is described in Binding z/OS XL C/C++ programs, or the prelinker, which is described in Prelinking and linking z/OS XL C/C++ programs.

The RENT option can be enabled under the METAL option to support constructed reentrancy for C programs with writable static and external variables. The writable static area (WSA) can be managed by user provided initialization and termination functions. For more information about how the RENT compiler option is supported by Metal C, see z/OS Metal C Programming Guide and Reference.
Notes:
  1. z/OS XL C++ code always uses constructed reentrancy so the RENT option is always in effect; you cannot specify NORENT for C++.
  2. RENT variables reside in the modifiable Writable Static Area (WSA) for both z/OS XL C and z/OS XL C++ programs.
  3. NORENT variables reside in the code area (which might be write protected) for z/OS XL C programs.
  4. The RENT compiler option has implications on how the binder processes objects. See z/OS MVS Program Management: User's Guide and Reference for further information.

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

IPA effects

If you specify RENT or use #pragma strings(readonly) or #pragma variable(rent | norent) during the IPA compile step, the information in the IPA object file reflects the state of each symbol.

If you specify the RENT option on the IPA link step, it ignores the option. The reentrant/nonreentrant state of each symbol is maintained during IPA optimization and code generation. If any symbols within a partition are reentrant, the option section of the Partition Map displays the RENT compiler option.

If you generate an IPA Link listing by using the LIST or IPA(MAP) compiler option, the IPA link step generates a Partition Map listing section for each partition. If any symbols within a partition are reentrant, the options section of the Partition Map displays the RENT compiler option.

Predefined macros

None.

Related information

For more information on related compiler options, see: