Date : Mon, 05 Mar 1984 14:16:00 EST
From : Bruce Hawkins <bhawkins%umass-cs.csnet@csnet-relay.arpa>
Subject: Bugs in Turbo Pascal
I am generally pleased with Turbo Pascal, especially its fast
compilation, but I have found two compiler bugs, both of which had
easy work arounds. The first is that it wold not accept the declaration
of a particular text file variable until I moved it to a non-standard
place ahead of the TYPE declarations (which is a legal extension to
Turbo Pascal). It accepts other similar declarations in other programs, so
the exact cause of the bug is unknown. (It would not accept it when
simply moved to a different place among the VAR declarations--I did not
try all possible such places!)
The second cost me a lot of time finding. Don't:
Type Junk = record
...
Name : Array [1..3] of Char;
...
End;
Var Iron : Junk;
.
.
.
Iron.Name := 'met';
Iron.Name containis random garbage. The work-around is:
Type as above
.
.
var temp : Array [1..3] of char;
.
.
temp := 'met';
Iron.Name := temp;
Iron.Name is now 'met' as was intended.
I don't have time to go poking around in Jenkins and Wirth to be sure
what is legal, but if the code isn't legal, the compiler should give
a syntax error message instead of being silent as the grave.
From the Rainbow of
Bruce Hawkins
bhawkins.umass-cs@csnet-relay