-K
arg1[,arg2...]
General input rules for the -K
option can be found on "Calling syntax and general rules".
The following entries are possible as arg arguments to control object generation:
Assembler commands for subroutine entries
subcall_basr
subcall_lab
-K subcall_basr
(default)
The BASR command is generated by default.
-K subcall_lab
The processor-independent LA and B assembler commands are generated. Programs using these commands will run on all 7500 systems.
Warning: This option is not allowed in the modes C++ 2017, C++ 2020 and C++ V3.
Generating the ETPND area
The following options are used to ignore the #pragma
directive for generating an ETPND area (see the section “ETPND pragma” in the C/C++ User Guide [4]) or to define the date format of the ETPND area.
no_etpnd
calendar_etpnd
julian_etpnd
-K no_etpnd
(default)
By default, no ETPND area is generated.
-K calendar_etpnd
The date format in the ETPND area is defined as follows:8 bytes calendar date - 4 bytes load address.
-K julian_etpnd
The date format in the ETPND area is defined as follows:6 bytes calendar date - 3 bytes Julian date - 4 bytes load address.
Generating the entry code for function calls
ilcs_opt
ilcs_out
-K ilcs_opt
(default)
The ILCS entry code is generated inline. This speeds up the runtime of the created object.
-K ilcs_out
A branch to the ILCS entry code for function calls in the runtime system is generated. This reduces the module code volume.
Handling enum data
enum_value
enum_long
-K enum_value
(default)
By default, the enum
data is handled as char
, short
or long
, depending on the value range.
-K enum_long
enum
data is always handled as type long
objects.
Generating the entry names with LLMs
llm_convert
llm_keep
-K llm_convert
(default)
By default, underscore characters are converted to dollar signs when entry names are generated.
-K llm_keep
The underscore characters are retained when generating entry names.
The underscore character conversion applies to all external symbols in the C language modes and only the symbols declared with external "C"
in the C++ language modes (not the entry names of the C library functions). The underscore character is always retained when coding external C++ symbols.
no_llm_case_lower
llm_case_lower
-K no_llm_case_lower
(default)
By default, lowercase letters are converted to uppercase when entry names are generated.
-K llm_case_lower
The lowercase letters are retained when entry names are generated.
The lowercase to uppercase conversion applies to all external symbols in the C language modes and the Cfront C++ mode, and only the symbols declared with extern "C"
in the modes C++ 2017, C++ 2020 and C++ V3. Lowercase letters are always retained when coding external C++ symbols in the modes C++ 2017, C++ 2020 and C++ V3.
Warning:
The C library functions are only available in full if one of the following combinations of options has been specified:
-K llm_convert
and-K no_llm_case_lower
-K llm_keep
and-K llm_case_lower
csect_suffix=
suffixcsect_hashpath
These options specify how CSECT names are formed. By default the CSECT name is derived from the module name, and the module name is derived from the source name as long as it is not explicitly specified.
The options can be sued to generate different CSECT names when the object names are the same.
With the help of these two options, a 30 character long string is created as the basis for the real CSECT names. This basis can be output using '-K verbose / -v'
.
The basis is changed in the usual manner by:
converting all lower case letters to upper case letters ,
converting all special characters such as ‘_’ or ‘.’ to ‘$’ and
adding ’&@’ or ’&#’ to generate real CSECT names.
With the help of these options you select different suffixes that are appended to the object names. If an object name is longer than 30 characters (not including the length of the suffix), then it is truncated.
-K csect_suffix=
With this option you specify a user-defined suffix. A maximum of 10 characters are used.
-K csect_hashpath
With this option you generate a 7 character long string from the full object path (including ’..’; links are not expanded). This character string is used as the suffix.
Storing const objects
roconst
no_roconst
-K no_roconst
(default)
By default, type const
objects are stored in the data module (WRITEABLE). This allows the values to be overwritten if the const
attribute is removed with a cast
operator.
-K roconst
Type const
objects are stored in the code module (READ-ONLY). The constants cannot be overwritten even if the const
attribute is removed with a cast
operator.
Caution: only global or local static
constants are affected. Local auto
variables with the const
type attribute cannot be stored in the READ-ONLY area.
Storing string constants
no_rostr
rostr
-K no_rostr
(default)
By default, string constants are stored in the data module (WRITEABLE). This allows the values to be overwritten if the const
attribute is removed with a cast
operator.
-K rostr
String constants and aggregate initialization constants are stored in the code module (READ-ONLY).
Floating-arithmetics in /390 and IEEE formats
no_ieee_floats
ieee_floats
-K no_ieee_floats
(default setting)
By default, floating point data types and operations in /390 format are used.
-K ieee_floats
The IEEE format is used for floating-point data types and operations. This applies to all variables and constants of the float
, double
and long double
data types inside the C/C++ programms.
Important:
The same C/C++ program can produce different results depending on whether the IEEE format or the /390 format is used for floating-point data types and operations. The reasons for this are as follows:
IEEE floating-point numbers use a different internal notation from /390 floating-point numbers.
IEEE floating-point operations use different semantics from /390 floatingpoint operations even on the same type of operation. This is the case, for example, in rounding. IEEE format uses "Round to Nearest" as default whereas /390 format uses "Round to Zero" as default.
C++ library functions do no support the IEEE format and must therefore be replaced with C functions where necessary (see the example below).
Prerequisites for using the IEEE-Format:
For each and every CRTE function that works with floating-point numbers in your program, you must use the corresponding or matching include file. If you do not do this, the CRTE functions will not be able to process the floating-point numbers correctly. You should ensure that you include the include file <stdio.h> for the function printf() with
#include <stdio.h>
.CRTE contains some C library functions which use the IEEE format for floatingpoint arithmetics. To ensure that the IEEE function names are correctly used, you should specify the following two options for the option
ieee_floats
:-K llm_keep
-K llm_case_lower
Generating shareable code
no_share
share
-K no_share
(default)
By default, the compiler does not generate any shareable code.
-K share
The compiler generates shareable code comprising a shared code CSECT and a non-shared data CSECT.Modules containing shareable code can only be meaningfully further processed in a BS2000 environment (SDF).
Storing workspace variables
workspace_static
workspace_stack
-K workspace_static
(default)
By default, workspace variables are stored in the static data area.
-K workspace_stack
The data required for workspace variables is stored on the stack.
Multiple definition of externally visible variables
external_multiple
external_unique
-K external_multiple
An externally visible variable that is defined in several modules is only assigned one memory area.
In order to achieve this, the variable may not be statically initialized in any of the definitions. The compiler places the memory for this variable in the COMMON area. If the variable is statically initialized during definition, the memory is placed in the data area. It is then not possible to assign it just one memory area.
This behavior is the default in K&R C mode.
-K external_unique
Externally visible variables may only be defined in just one module and must be declared as external
in all other modules. The memory space for such variables is placed in the data module of the object in which the variable was defined.This behavior is the default in the language modes C89, C11 and all C++ language modes. The default may not be changed in the C++ language modes.
Length of external C names
The following options define the length of external C names and affect all external symbols in the C language modes, but only the symbols declared with extern "C"
in the C++ modes (not the entry names of C library functions).
c_names_std
c_names_unlimited
c_names_short
-K c_names_std
(default)
By default, external C names may be a maximum of 32 characters long. Longer names are truncated by the compiler to 32 characters. Only 30 characters are allowed when generating shareable code (-K share
).
-K c_names_unlimited
Names are not truncated. In this case, the compiler generates entry names in EEN format. EENs can have a length of up to 32000 characters. Modules containing EENs are saved by the compiler in LLM Format 4. More detailed information on how LLMs in Format 4 are processed further can be found on "Link editor options" (-B extended_external_names
). EENs are not supported in the Cfront C++ mode.
-K c_names_short
External C names are truncated to 8 characters.
Note
Options which affect the length of external names also affect the names of static functions as the compiler handles the names of static functions like the names of external functions.