cdecl calling convention causes the compiler not to recognize open array parameters
Original Reporter info from Mantis: ppopov99
-
Reporter name: Peter Popov
Original Reporter info from Mantis: ppopov99
- Reporter name: Peter Popov
Description:
The following code causes the compiler to report an illegal expression. Compiled with -Sd swithc.
unit TestArrParams;
interface
type
TMyClass = class
constructor A(const arg: array of Double);
end;
procedure B(arg: array of double); cdecl;
implementation
constructor TMyClass.A(const arg: array of double);
begin
writeln(arg[0]);
end;
procedure B;
begin
TMyClass.A(arg); // Illegal expression
end;
begin
B([2, 3]);
end.
Additional information:
Similar issue results if B is declared:
procedure B(arg: array of douible); cdecl; forward;
and then implemented.
Mantis conversion info:
- Mantis ID: 6940