[fpc-pascal]No runtime range checking?

Andy Sy andy at netfxph.com
Thu Oct 2 13:08:47 CEST 2003


program blah;

type
   stringy = array[4..10] of char;

var
   C: stringy;
   D: array[2..5] of char;

procedure showstring(I:Integer);
begin
   Write(C[I]);
end;

begin
   C:='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
   D:='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
   Writeln(D);
   showstring(-5);
end.


FPC doesn't even complain about range exceeded whether
during compilation or runtime... isn't this an egregious
violation of Pascal's strict typing philosophy?  Does
Turbo Pascal/Delphi behave this way as well?






More information about the fpc-pascal mailing list