-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 the compiler frontend in the C and C++ modes:
uchar
schar
The default data type char
is unsigned char
. If -K schar
is specified, char
is treated as a signed char
in expressions and conversions.
Note that the use of this option may result in portability problems!
at
no_at
If -K no_at
is specified, the “at” sign ‘@’ is not allowed in identifiers.
The default is -K at
. The ‘@’ sign in identifiers is an extension.
If you are using a Cfront C++ library, you cannot use the option -K no_at
.
dollar
no_dollar
If -K no_dollar
is specified, the dollar sign ‘$’ is not allowed in identifiers.
The default is -K dollar
. The ‘$’ sign in identifiers is an extension.
literal_encoding_native
literal_encoding_ascii
literal_encoding_ascii_full
literal_encoding_ebcdic
literal_encoding_ebcdic_full
This option determines whether the C/C++ compiler creates the code for characters or for strings in EBCDIC or ASCII format (ISO 8859-1).
In C/C++, literal strings can contain binary coded characters as octal or hexadecimal escape sequences with the following syntax:
octal escape sequences:
́\[0-7] [0-7][0-7] ́
hexadecimal escape sequences:
́\x[0-9A-F][0-9A-F] ́
Whether or not the C/C++ compiler escape sequences are converted into ASCII format depends on the value specified for the option literal_encoding_
... .
literal_encoding_native
The C/C++ compiler leaves the character and literal string code in the EBCDIC format, i.e. it transfers the characters and strings into the object code without converting them. literal_encoding_native
is the default setting.
literal_encoding_ascii
The C/C++ compiler encodes the characters and literal strings in ASCII format. Strings containing escape sequences will not be converted into ASCII format.
literal_encoding_ascii_full
The C/C++ compiler encodes the characters and literal strings in ASCII format. Strings containing escape sequences will be converted into ASCII format.
literal_encoding_ebcdic
The C/C++ compiler leaves the character and literal string code in the EBCDIC format, i.e. it transfers the characters and strings into the object code without converting them.literal_encoding_ebcdic
has the same effect asliteral_encoding_ebcdic_full
or literal_encoding_native
.
literal_encoding_ebcdic_full
The C/C++ compiler leaves the character and literal string code in the EBCDIC format, it transfers the characters and strings into the object code without converting them. literal_encoding_ebcdic_full
has the same effect asliteral_encoding_ebcdic
or literal_encoding_native
.
Prerequisites for using the ASCII Format:
- You must not explicitly declare the C library functions in your source program, but only indirectly by including the corresponding CRTE header. Otherwise a tranlation error ‘CFE1079[ERROR]..: expected a type specifier‘ may occur.
For each and every CRTE function (C library function) in your program that works with characters or strings, 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 character strings correctly. You should ensure that you include the include file
<stdio.h>
for the function printf() with#include <stdio.h>
.If you are using CRTE functions you must also specify the following options:
-K llm_keep
-K llm_case_lower
signed_fields_signed
signed_fields_unsigned
If -K signed_fields_unsigned
is specified, signed
bit fields are always interpreted as unsigned
. This option is only offered for compatibility with older C versions and is only meaningful in K&R C mode.
The default is -K signed_fields_signed
.
plain_fields_signed
plain_fields_unsigned
These arguments control whether integer bit fields (short
, int
, long
, long long
) are treated as signed
or unsigned
types by default.
The default is -K plain_fields_signed
.
long_preserving
unsigned_preserving
These arguments control whether arithmetic operations with operands of type long
and unsigned int
return a result of type long
(long_preserving
) in accordance with K&R mode (first edition; appendix 6.6) or of type unsigned long
(unsigned_preserving
) in accordance with ANSI/ISO C.
The default is -K unsigned_preserving
.
alternative_tokens
no_alternative_tokens
These arguments control whether alternative tokens are to be recognized by the compiler:
Digraph sequences in the C and C++ language modes (e.g.
<:
for[
),Additional keyword operators which are only valid in the C++ language modes (e.g.
and
for&&
,bitand
for&
).
-K alternative_tokens
is the default in the modes C11, C++ V3, C++ 2017 and C++ 2020,-K no_alternative_tokens
is the default for all other modes.
longlong
no_longlong
These arguments control whether the data type long long
is recognized by the compiler.-K longlong
is the default. In this case, the preprocessor define _LONGLONG
is set.
If -K no_longlong
is set, the use of the data type long long
will result in an error. This specification is only allowed in the language modes C89 and C++ V3.
end_of_line_comments
no_end_of_line_comments
These arguments control whether the compiler accepts C++-style comments (//...) in the extended C89 mode as well. -K no_end_of_line_comments
is the default in the extended C89 mode.
Only one entry is permitted in the other language modes, the other is ignored with a warning. In the strict C89 mode and in the K&R mode, C++ comments are not allowed. In the C++ modes and in the C11 mode they are always allowed.