HP SunSoft Pascal 4.0 Uživatelský manuál Strana 66

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 333
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 65
42 Pascal 4.0 Users 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.
Zobrazit stránku 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 332 333

Komentáře k této Příručce

Žádné komentáře