HP Pascal/iX Reference Manual (31502-90022)

A-: 2
8. When a value is established for the tag field of a record with
variants, it is illegal to use a field in another variant.
9. The compiler does not always detect uninitialized variables,
especially in these cases:
a. The path to use a variable cannot include the initializing
statement. Suppose:
PROCEDURE proc_a;
VAR
x,y : integer;
BEGIN
IF
condition
THEN x := 10 ELSE y := x;
.
.
.
END;
The assignment after ELSE does not cause a compile-time
error, even if
x
has not been initialized outside the IF
statement. (The compiler counts the assignment after THEN
as initialization.)
b. Not all the components of a record or array have been
assigned values. (The compiler counts the assignment to a
single component as initialization of the entire variable.)
c. An uninitialized global variable appears in a program
compiled with GLOBAL or EXTERNAL options, or in a program
that contains procedures or functions declared with the
EXTERNAL directive. (The compiler cannot check outside the
current source code.)
d. An uninitialized dynamic variable on the heap. (The
compiler cannot detect this at run time.)
e.
Strwrite
into an uninitialized string variable.
However, some of the above errors are detected when the compiler
option OPTIMIZE is ON.
10. An actual reference parameter cannot be an expression consisting
of a single variable in parentheses.
11. Case constant labels cannot be constant expressions.
12. Range checking code is suppressed when the type of logical file is
identical to the type of a variable to which a file component is
assigned. However, a physical file associated with the logical
file can have values out of range and the consequent errors are
undetected.
13. Applying
put
to an undefined file buffer variable.
14. The control variable of a FOR statement is undefined after the
execution of the FOR statement.
15. Dereferencing an undefined pointer is not always detected,
especially for pointers that have never been explicitly disposed.
16. Using a variable created with the long form of
new
as an actual
parameter.
17. Using a variable created with the long form of
new
in a assignment
statement.
18. Using a variable created with the long form of
new
in a factor
(for example, as an operand in an expression).
19. Altering the value of the record variable of a WITH statement
within the scope of the WITH statement.
20. Using
put, dispose,
or
release
to make an actual variable
parameter to a procedure undefined within the body of the
procedure.