On Mon, 29 Jan 2018, Zoë Peterson wrote:
In the code below Bar creates a reference counted object and returns an
interface to it. Foo calls Bar but doesn't assign the result anywhere.
In Delphi, this produces the result:
Foo >
TAutoRelease.Create
Foo <
TAutoRelease.Destroy
But in F
2018-01-29 23:32 GMT+01:00 Zoë Peterson :
> Is Free Pascal's behavior intentional? Can it be changed to match Delphi?
>
the topic is well known. I have plan to add new modeswitch for that:
SCOPEDINTERFACEDESTROY
If you like you can try existing patch:
https://bugs.freepascal.org/view.php?id=3
On 2018-01-29 22:32, Zoë Peterson wrote:
Is Free Pascal's behavior intentional? Can it be changed to match Delphi?
Something I've queried with the FPC developers some 10 years ago. The
Delphi behaviour is undocumented, so developers are relying on a
implementation detail that could change wi
In the code below Bar creates a reference counted object and returns an
interface to it. Foo calls Bar but doesn't assign the result anywhere.
In Delphi, this produces the result:
Foo >
TAutoRelease.Create
Foo <
TAutoRelease.Destroy
But in Free Pascal it produces this:
Foo >
TAutoR
El 27/01/18 a las 15:10, C Western escribió:
The following innocuous looking code generates a range check error:
{$R+}
function Count: qword;
begin
Result := 0;
end;
var
i: Integer;
begin
for i := 0 to Count-1 do
WriteLn(i);
end.
I can (more or less) see why, but it means that I can't