#pragma runopts

Purpose

Specifies a list of runtime options for the compiler to use at execution time.

Syntax

Read syntax diagramSkip visual syntax diagram
                          .-,---------.      
                          V           |      
>>-#--pragma--runopts--(----suboption-+--)---------------------><

Defaults

Not applicable.

Parameters

suboption
A z/OS® Language Environment® run-time option or any of the compiler run-time options ARGPARSE, ENV, PLIST, REDIR, or EXECOPS. For more information on z/OS run-time options, see the z/OS XL C/C++ User's Guide and z/OS Language Environment Programming Guide.

Usage

Specify your #pragma runopts directive in the translation unit that contains main. If more than one translation unit contains a #pragma runopts directive, unpredictable results can occur; the #pragma runopts directive only affects translation units containing main.

If a suboption to #pragma runopts is not a valid C or C++ token, you can surround the suboptions to #pragma runopts in double quotes. For example, use:
#pragma runopts ( " RPTSTG(ON)
TEST(,,,VADTCPIP&1.2.3.4:*) " )
instead of:
#pragma runopts ( RPTSTG(ON) TEST(,,,VADTCPIP&1.2.4.3:*))

IPA effects

This pragma only affects the IPA compile step if you specify the OBJECT suboption of the IPA compiler option.

The IPA compile step passes the effects of this directive to the IPA link step.

Consider if you specify ARGPARSE|NOARGPARSE, EXECOPS|NOEXECOPS, PLIST, or REDIR|NOREDIR either on the #pragma runopts directive or as a compile-time option on the IPA compile step, and then specify the compile-time option on the IPA link step. In this case, you override the value that you specified on the IPA compile step.

If you specify the TARGET compile-time option on the IPA link step, it has the following effects on #pragma runopts :
  • It overrides the value you specified for #pragma runopts(ENV). If you specify TARGET(LE) or TARGET(), the compiler sets the value of #pragma runopts(ENV) to MVS™. If you specify TARGET(IMS™), the compiler sets the value of #pragma runopts(ENV) to IMS.
  • It may override the value you specified for #pragma runopts(PLIST). If you specify TARGET(LE) or TARGET(), and you specified something other than HOST for #pragma runopts(PLIST), the compiler sets the value of #pragma runopts(PLIST) to HOST. If you specify TARGET(IMS), the compiler sets the value of #pragma runopts(PLIST) to IMS.
For #pragma runopts options other than those that are listed above, the IPA link step follows these steps to determine which #pragma runopts value to use:
  1. The IPA link step uses the #pragma runopts specification from the main routine, if the routine exists.
  2. If no main routine exists, the IPA link step follows these steps:
    1. If you define the CEEUOPT variable, the IPA link step uses the #pragma runopts value from the first translation unit that it finds that contains CEEUOPT.
    2. If you have not defined the CEEUOPT variable in any translation unit, the IPA link step uses the #pragma runopts value from the first translation unit that it processes.
    The sequence of translation unit processing is arbitrary.
To avoid problems, you should specify #pragma runopts only in your main routine. If you do not have a main routine, specify it in only one other module.

Related information