[fpc-devel] bug or feature?

Sergei Gorelkin sergei_gorelkin at mail.ru
Fri Nov 22 16:09:35 CET 2013


Hello together,

The following compiles and executes correctly in objfpc mode (and rejected by Delphi and by FPC in 
mode Delphi). Is implicit taking address of array there by design?

type
   PReal = ^Real;
const
   xa: array[0..3] of Real = (1.0,2.0,3.0,4.0);

procedure test(x: PReal);
begin
   writeln(x[3]);
end;

begin
   test(xa);   // prints 4.0e+0
end.

Regards,
Sergei



More information about the fpc-devel mailing list