#pragma longname/nolongname

Purpose

Specifies whether the compiler is to generate mixed-case names that can be longer than 8 characters in the object module.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-#--pragma--+-longname---+-----------------------------------><
              '-nolongname-'   

Defaults

  • C only. nolongname C only.
  • C++ only. longname C++ only.

Parameters

longname
The compiler generates mixed-case names in the object module. Names can be up to 1024 characters in length.
nolongname
The compiler generates truncated and uppercase names in the object module. C++ only. Only functions that do not have C++ linkage are given truncated and uppercase names. C++ only.

Usage

If you use the #pragma longname directive, you must either use the binder to produce a program object in a PDSE, or you must use the prelinker. The binder, IPA link step, and prelinker support the long name directory that is generated by the Object Library utility for autocall.

If you specify the NOLONGNAME or LONGNAME compiler option, the compiler ignores the #pragma longname directive. If you specify either #pragma nolongname or the NOLONGNAME compiler option, and this results in mapping of two different source code names to the same object code name, the compiler will not issue an error message.

C only. If you have more than one preprocessor directive, #pragma longname may be preceded only by #pragma filetag, #pragma chars, #pragma langlvl, and #pragma target. Some directives, such as #pragma variable and #pragma linkage, are sensitive to the name handling. C only.

C++ only. You must specify #pragma longname/nolongname before any code. Otherwise, the compiler issues a warning message. #pragma nolongname must also precede any other preprocessing directive. C++ only.

IPA effects

You must specify either the LONGNAME compile option or the #pragma longname preprocessor directive for the IPA compile step (unless you are using the c89 or cc utility from z/OS® UNIX System Services, both of which already specify the LONGNAME compiler option). Otherwise, you will receive an unrecoverable compiler error.

Related information