On 09 Mar 2013, at 02:37, Joao Morais wrote:
> On Fri, Mar 8, 2013 at 4:09 PM, Flávio Etrusco <flavio.etru...@gmail.com>
> wrote:
>>
>>> procedure addintf(const aintf: IUnknown);
>>> (...)
>>> addintf(TInterfacedObject.Create);
>>> (...)
>>
>> It's a pity, but I don't know whether it's fixable (or if needs to be
>> "fixed") in the compiler.
>
> Works in Delphi 7 with FastMM4.
[...]
> You are suggesting that this unlikely coincidente which causes a
> sigsegv should be the programmer's responsibility. No thanks, I much
> more prefer the Delphi compatibility =)
It indeed only works by accident in your Delphi code. It is just as wrong in
Delphi as it is in FPC. It depends on an implementation detail of the code
generator's reference counting. It's like saying that a particular piece of
code in which an uninitialized local variable happens to be always 0 in Delphi
should have the same behaviour in FPC. We don't aim for compatibility as far as
providing the same behaviour for code of which the result is undefined.
Jonas
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal