[fpc-devel] open array and address of "@" / crash, why?

Howard Page-Clark hdpc at talktalk.net
Mon Mar 31 17:42:27 CEST 2014


On 31/03/2014 14:28, Martin Frb wrote:
> Shortened example:
>
> program project1;
> {$t+}
> var
>    a : array of integer;
>
> procedure Foo(var c: array of integer);
> begin
>    writeln( (@c)^[1] );
>    readln;
> end;
>
> begin
>    SetLength(a,5);
>    a[0]:= 100;
>    a[1]:= 101;
>    foo(a);
> end.

This compiles here (FPC 2.6.5, Win32), and produces the output "101" 
with no errors.

Howard




More information about the fpc-devel mailing list