Syntax: -Snn
Default: nn = 64
Notes: See also specify stack size.
5.1.2.2.44 -u* Trap use of undefined values
This command-line compiler option enables/disables checking for undefined values.
Syntax: -u[+|-]
Default: Enabled
Notes: When this option is enabled the compiler generates code which checks each time your program
gets a value from a variable to make sure that the value is not undefined. If your program does get an
undefined value from a variable then the code generated by the compiler will issue a run-time error
message and terminate your program.
So for example if you compile and run the following program
program bad(output);
var
r : real;
begin
writeln(r) (* The value of "r" is undefined *)
end.
The program will terminate with a run-time error message because of the attempt to print the value of
r which is undefined. Unfortunately not all variable accesses can be checked, checks are only made for
accesses to variables of the following types:
enumerated types (including boolean)
subranges of enumerated types
subranges of integer that do not include -1
file
list
object
pointer
real
set (array representation)
Accesses to variables of types char, integer, record and set (Bit set representation) are not checked.
Checking for undefined values is performed as follows:
All memory is initialized by setting all bits to 1.
When accessing a variable a check is performed to see if all bits are set and if they are this
variable is undefined. This doesn't work for char, integer or set (bit set representation) variables
since a value with all bits set to 1 is valid for these variables. Record variables are not checked
because they may contain fields which can not be checked.