42
Pascal 4.0 User’s Guide
3
The compiler issues warnings at the end of the procedure where the record
variables are defined, that is, when some of the fields are definitely not set.
However, no warnings are issued if fields are used in the source before they are
initialized, as the control flow may be different.
In some cases, it is not possible to determine at compile time whether the fields
have actually been initialized. For example:
•
For the array variable
V
, whose elements are records, if any assignment of
the kind
V[i]:= X or V[i].F:= Y
occurs, the compiler considers the
corresponding fields of
V[i]
for all values of
i
to be initialized. If such a
field is used, but not set, it is denoted as
V[...].F
in the warning message.
•
All formal parameters are assumed to be initialized. Consequently, the
compiler does not perform any checking for these component fields.
With the
-Rw
option, the compiler takes into account built-in procedures which
initialize their argument variables, for example,
reset(f)
for the file buffer
variable
f^
and its components.
rewrite(f)
does not initialize
f^
. The
compiler also examines field handling inside
WITH
statements.
Use the
-Rw
option to check the use of “unsafe” variant records, such as the
assignment of a variant to a field, or the use of another field from a “parallel”
variant. These practices may result in runtime errors which are hard to find.
Note –
The
-Rw
option requires extra compile-time, and is, therefore,
recommended for use in debugging only.
Summary of Contents for SunSoft Pascal 4.0
Page 14: ...xiv Pascal 4 0 User s Guide ...
Page 16: ...xvi Pascal 4 0 User s Guide ...
Page 30: ...6 Pascal 4 0 User s Guide 1 ...
Page 160: ...136 Pascal 4 0 User s Guide 6 ...
Page 268: ...244 Pascal 4 0 User s Guide 11 ...
Page 320: ...296 Pascal 4 0 User s Guide B ...
Page 331: ...Index 307 ...
Page 333: ......