The Seed7 compiler is capable to use different C compilers and C runtime libraries
as back end. The program chkccomp.c determines the properties of the back end.
This is done when Seed7 interpreter and runtime library are compiled.
The properties of the back end are available in Seed7 via the library cc_conf.s7i.
This library defines ccConf, which is a constant of type ccConfigType.
The type ccConfigType contains elements to descibe the properties:
Type |
Name |
Description |
boolean |
WITH_STRI_CAPACITY |
TRUE, if the Seed7 runtime library uses strings with capacity.
The capacity of a string can be larger than its size.
Strings with capacity can be enlarged without calling realloc(). |
boolean |
ALLOW_STRITYPE_SLICES |
TRUE, if the actual characters of a string can be stored elsewhere.
This allows string slices without the need to copy characters. |
boolean |
ALLOW_BSTRITYPE_SLICES |
TRUE, if the actual characters of a bstring can be stored elsewhere.
This allows bstring slices without the need to copy characters. |
boolean |
RSHIFT_DOES_SIGN_EXTEND |
TRUE, if the sign of negative signed integers is preserved with a
right shift. The C standard specifies that the right shift of signed integers is
implementation defined, if the shifted values are negative. |
boolean |
TWOS_COMPLEMENT_INTTYPE |
TRUE, if signed integers are represented as twos complement
numbers. This allows some simplified range checks in compiled
programs. |
boolean |
LITTLE_ENDIAN_INTTYPE |
TRUE, if the byte ordering of integers is little endian. |
boolean |
FLOAT_COMPARISON_OKAY |
TRUE, if float comparisons with NaN and negative zero work okay.
A comparison between NaN and any other value should return FALSE.
Negative zero should be considered as identical to positive zero.
Comparison refers to comparisons with == < > <= or >= .
If FLOAT_COMPARISON_OKAY is FALSE fltEq(), fltLt(), fltGt(), fltLe()
and fltGe() should be used to do comparisons of float values. |
boolean |
POW_FUNCTION_OKAY |
TRUE, if pow() works okay for a base of zero, one or NaN.
If it is FALSE fltPow() should be used instead of pow(). |
boolean |
FMOD_FUNCTION_OKAY |
TRUE, if fmod() works okay for Infinity, NaN and zero.
If it is FALSE fltRem() should be used instead of fmod(). |
boolean |
SQRT_FUNCTION_OKAY |
TRUE, if sqrt() works okay for a negative argument.
If it is FALSE fltSqrt() should be used instead of sqrt(). |
boolean |
EXP_FUNCTION_OKAY |
TRUE, if exp() works okay for NaN.
If it is FALSE fltExp() should be used instead of exp(). |
boolean |
LOG_FUNCTION_OKAY |
TRUE, if log() works okay for zero, a negative values and NaN.
If it is FALSE fltLog() should be used instead of log(). |
boolean |
LOG10_FUNCTION_OKAY |
TRUE, if log10() works okay for zero, a negative values and NaN.
If it is FALSE fltLog10() should be used instead of log10(). |
boolean |
LOG1P_FUNCTION_OKAY |
TRUE, if log1p() works okay for -1.0, values < -1.0 and NaN.
If it is FALSE fltLog1p() should be used instead of log1p(). |
boolean |
LOG2_FUNCTION_OKAY |
TRUE, if log2() works okay for zero, a negative values and NaN.
If it is FALSE fltLog2() should be used instead of log2(). |
boolean |
LDEXP_FUNCTION_OKAY |
TRUE, if ldexp() works okay for NaN.
If it is FALSE fltLdexp() should be used instead of lsexp(). |
boolean |
FREXP_FUNCTION_OKAY |
TRUE, if frexp() works okay for Infinity, NaN and subnormal numbers.
If it is FALSE fltDecompose() should be used instead of frexp(). |
boolean |
HAS_SIGSETJMP |
TRUE, if the functions sigsetjmp() and siglongjmp() are available.
If it is FALSE the functions setjmp() and longjmp() must be used instead. |
boolean |
CHECK_INT_DIV_BY_ZERO |
TRUE if integer divisions must be checked for a division by zero.
This applies to the division operations div and mdiv.
The generated C code should, if a division by zero occurs,
raise the exception NUMERIC_ERROR instead of doing the
illegal divide operation. If CHECK_INT_DIV_BY_ZERO is FALSE
a division by zero always triggers SIGFPE. SIGFPE is caught
by the Seed7 run-time library and triggers a NUMERIC_ERROR. |
boolean |
CHECK_INT_DIV_ZERO_BY_ZERO |
TRUE if the C expression 0/0 might not trigger SIGFPE.
C compilers assume that so called "undefined behavior" will
not happen. According to the C standard a division by 0
triggers undefined behavior. This way a C compiler is allowed
to optimize the expressions 0/0 and 0/variable to 0. Likewise
the expression variable/variable can be optimized to 1.
In Seed7 a division by zero is defined behavior, since it
raises the exception NUMERIC_ERROR. This configuration
setting applies to the division operations div and mdiv.
The generated C code should, if a division by zero occurs,
raise the exception NUMERIC_ERROR instead of allowing the
C compiler to do its optimization. |
boolean |
CHECK_INT_REM_BY_ZERO |
TRUE if integer remainder must be checked for a division by zero.
This applies to the division operations rem and mod.
The generated C code should, if a remainder by zero occurs,
raise the exception NUMERIC_ERROR instead of doing the
illegal divide operation. If CHECK_INT_REM_BY_ZERO is FALSE
a remainder by zero always triggers SIGFPE. SIGFPE is caught
by the Seed7 run-time library and triggers a NUMERIC_ERROR. |
boolean |
CHECK_INT_REM_ZERO_BY_ZERO |
TRUE if the C expression 0%0 might not trigger SIGFPE.
C compilers assume that so called "undefined behavior" will
not happen. According to the C standard a division by 0
triggers undefined behavior. This way a C compiler is allowed
to optimize the expressions 0%0 and 0%variable to 0. Likewise
the expression variable%variable can be optimized to 0.
In Seed7 a division by zero is defined behavior, since it
raises the exception NUMERIC_ERROR. This configuration
setting applies to the division operations rem and mod.
The generated C code should, if a division by zero occurs,
raise the exception NUMERIC_ERROR instead of allowing the
C compiler to do its optimization. |
boolean |
FLOAT_ZERO_DIV_ERROR |
TRUE, if the C compiler classifies a floating point division by zero as fatal error. |
boolean |
CHECK_FLOAT_DIV_BY_ZERO |
TRUE, if a C floating point division by zero does not return the IEEE 754
values Infinity, -Infinity or NaN. In this case the interpreter checks all
float divisions and returns the correct result. Additionally the Seed7 to C
compiler generates C code, which checks all float divisions ( / and /:= ) for
division by zero. The generated C code should return Infinity,
-Infinity or NaN instead of doing the divide operation. |
boolean |
HAS_EXP2 |
TRUE, if the C function exp2() is present. |
boolean |
HAS_EXP10 |
TRUE, if the C function exp10() is present. |
boolean |
HAS_EXPM1 |
TRUE, if the C function expm1() is present. |
boolean |
HAS_CBRT |
TRUE, if the C function cbrt() is present. |
boolean |
LIMITED_CSTRI_LITERAL_LEN |
TRUE, if the C compiler limits the length of string literals.
Some C compilers limit the maximum string literal length.
There are limits of 2,048 bytes and 16,384 (16K) bytes.
The actual limit is not interesting, but the fact that
a limit exists or does not exist. |
boolean |
SWITCH_WORKS_FOR_INT64TYPE |
TRUE, if switch statements work with 64-bit values. |
boolean |
STMT_BLOCK_IN_PARENTHESES_OK |
TRUE, if a compound statement is allowed in a parentesized expression. |
boolean |
CC_SOURCE_UTF8 |
TRUE, if the C compiler accepts UTF-8 encoded file names in #line directives.
The file names from #line directives are used by the debugger to
allow source code debugging. |
boolean |
USE_WMAIN |
TRUE, if the main function is named wmain.
This is a way to support Unicode command line
arguments under Windows. An alternate way to
support Unicode command line arguments under
Windows uses the functions getUtf16Argv() and
freeUtf16Argv() (both defined in "cmd_win.c"). |
boolean |
USE_WINMAIN |
TRUE, if the main function is named WinMain. |
boolean |
USE_DO_EXIT |
TRUE, if the main function must be terminated with doExit(). |
boolean |
FLOATTYPE_DOUBLE |
TRUE, if the type floatType is double.
If it is FALSE floatType is float. |
integer |
INTTYPE_SIZE |
Size of the type intType in bits (either 32 or 64). |
integer |
FLOATTYPE_SIZE |
Size of the type floatType in bits (either FLOAT_SIZE or DOUBLE_SIZE). |
integer |
POINTER_SIZE |
Size of a pointer in bits. |
integer |
GENERIC_SIZE |
The maximum of INTTYPE_SIZE, FLOATTYPE_SIZE and POINTER_SIZE.
This is also the size in bits of the types rtlValueunion,
rtlObjecttype and generictype (defined in data_rtl.h). |
integer |
INT_SIZE |
Size of the type int in bits. |
integer |
INT_MIN |
Minimum value of the type int. |
integer |
INT_MAX |
Maximum value of the type int. |
integer |
LONG_SIZE |
Size of the type long in bits. |
integer |
FLOATTYPE_MANTISSA_BITS |
Number of mantissa bits in the binary floatType representation. |
integer |
FLOATTYPE_EXPONENT_OFFSET |
Exponent offset in the binary floatType representation. To get the actual exponent the offset must be subtracted. |
integer |
INT_RANGE_IN_FLOATTYPE_MAX |
Maximum from the continuous range of integers that map to floats.
All integers from -INT_RANGE_IN_FLOATTYPE_MAX to
INT_RANGE_IN_FLOATTYPE_MAX can be converted to floatType
and back to intType without loss. |
integer |
MINIMUM_TRUNC_ARGUMENT |
Minimum value that trunc() or round() can convert.
Values below MINIMUM_TRUNC_ARGUMENT raise RANGE_ERROR,
if trunc() or round() is applied to them. |
integer |
MAXIMUM_TRUNC_ARGUMENT |
Maximum value that trunc() or round() can convert.
Values above MAXIMUM_TRUNC_ARGUMENT raise RANGE_ERROR,
if trunc() or round() is applied to them. |
integer |
PIXEL_RED_MASK |
Mask for the red color in a pixel. 0 if there is no mapping and drwRgbColor() should be used. |
integer |
PIXEL_GREEN_MASK |
Mask for the green color in a pixel. 0 if there is no mapping and drwRgbColor() should be used. |
integer |
PIXEL_BLUE_MASK |
Mask for the blue color in a pixel. 0 if there is no mapping and drwRgbColor() should be used. |
string |
RGB_TO_PIXEL_FLAG_NAME |
Name of the variable deciding between macro and drwRgbColor(). "" if no variable needs to be checked. |
integer |
RAND_MULTIPLIER |
Multiplier for the linear congruential generator. A well known pseudorandom number generator algorithm. |
integer |
RAND_INCREMENT |
Increment for the linear congruential generator. A well known pseudorandom number generator algorithm. |
string |
BOOLTYPE |
Name of a type for the boolean values 0 and 1.
The runtime library and the compiler use a typedef to define
the type boolType with BOOLTYPE. |
string |
INT32TYPE |
Name of a signed integer type that is 32 bits wide.
The runtime library and the compiler use a typedef to define
the type int32Type with INT32TYPE. |
string |
UINT32TYPE |
Name of an unsigned integer type that is 32 bits wide.
The runtime library and the compiler use a typedef to define
the type uint32Type with UINT32TYPE. |
string |
INT64TYPE |
Name of a signed integer type that is 64 bits wide.
The runtime library and the compiler use a typedef to define
the type int64Type with INT64TYPE. |
string |
UINT64TYPE |
Name of an unsigned integer type that is 64 bits wide.
The runtime library and the compiler use a typedef to define
the type uint64Type with UINT64TYPE. |
string |
INT128TYPE |
Name of a signed integer type that is 128 bits wide.
The runtime library and the compiler use a typedef to define
the type int128Type with INT128TYPE. Empty string if
there is no 128-bit signed integer type. |
string |
UINT128TYPE |
Name of an unsigned integer type that is 128 bits wide.
The runtime library and the compiler use a typedef to define
the type uint128Type with UINT128TYPE. Empty string if
there is no 128-bit unsigned integer type. |
string |
INT32TYPE_LITERAL_SUFFIX |
The suffix used by the literals of the type int32Type. |
string |
INT64TYPE_LITERAL_SUFFIX |
The suffix used by the literals of the type int64Type. |
string |
MACRO_DEFS |
Definition of several macros (likely, unlikely, noreturn). |
string |
OVERFLOW_SIGNAL |
Name of the signal that is raised if an integer overflow
occurs. Empty string if integer overflow does not raise
a signal. |
string |
BUILTIN_ADD_OVERFLOW |
Name of a C compiler builtin function to add with overflow check.
Empty string if there is no such builtin function. |
string |
BUILTIN_SUB_OVERFLOW |
Name of a C compiler builtin function to subtract with overflow check.
Empty string if there is no such builtin function. |
string |
BUILTIN_MULT_OVERFLOW |
Name of a C compiler builtin function to multiply with overflow check.
Empty string if there is no such builtin function. |