gtpa2m2cApplication Programming

Compiling and Running C/C++ Programs

This section contains a brief description of compiling and running C or C++ programs. See the user's guide for the IBM C or C++ compiler on the System/390 platform used by your installation for more detailed information about compiling C and C++ application programs.

The following briefly describes the RENT and LONGNAME compiler options.

RENT
Causes the compiler to generate reentrant code. Reentrancy of a single variable can be controlled by coding
#pragma variable( vbl, RENT )

RENT must be used if the program uses writable static. The RENT directive is not required if the program being compiled does not use writable static. If RENT is not used and writable static is encountered, a system error occurs. If RENT is used and there is no writable static, there is a performance loss associated with secondary linkage.

The RENT/NORENT option and #pragma variables are not supported for TARGET(TPF).

This parameter is assumed if the TARGET(TPF) option is used.

Note:
There is no RENT compiler option in the family of IBM C++ compilers on the System/390 platform. Source code written in C++ and compiled with a C++ compiler will automatically be compiled as RENT.

See TPF Programming Standards for more information about the TPF RENT standard. See Sample Code Written to the RENT Standard for code samples.

LONGNAME/NOLONGNAME
Enables or suppresses support for long and mixed case external variable names. This directive is not supported for TARGET(TPF).

Compiling with the LONGNAME option allows you to use external names that are unique in the first 255 characters, with case respected. For code compiled with the NOLONGNAME compiler option, all identifiers that have external linkage must have names that are unique in the first 8 characters, ignoring case.

Segments that will be linked into a single load module must be compiled either all with the LONGNAME option or all with the NOLONGNAME option.

See TPF Programming Standards for more information about the LONGNAME standard.