[fpc-pascal]Dereferencing Nil Pointers

Mark Emerson mark at angelbase.com
Sun Dec 29 06:03:41 CET 2002


I did not find "Attempted to dereference a NIL pointer" as a runtime
error in FPC (except for error 204 which involves calls to dispose or
Freemem).  

For example:

var
  x : ^char;
  y : char;
begin
  x := nil;
  y := x^;
end.

should produce a runtime error at the second statement.  This was a
deficiency in Turbo Pascal.  Is there any way to turn on such checking
in FPC?  

MarkLDE




More information about the fpc-pascal mailing list