2012/9/25 Bernd <prof7...@gmail.com>:
> 2012/9/25 patspiper <patspi...@gmail.com>:
>> procedure test;
>> begin
>>   Move(MyClass1.Ref.Data^, MyClass2.Ref.Data^, 1);
>> end;
>
> and if you cast it to some other pointer type before dereferencing the
> error goes away:
>
> procedure test;
> begin
>   Move(MyClass1.Ref.Data^, PByte(MyClass2.Ref.Data)^, 1);
> end;
>
> But this should not be necessary.

Why not?  The error is correct. By using the type cast you tell the
compiler you know what you are doing and that is should not bother
doing the sanity check.

So IMO, not a bug.

Vincent
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to