[fpc-pascal] Error: Can't take the address of constant expressions

patspiper patspiper at gmail.com
Tue Sep 25 20:41:29 CEST 2012


On 25/09/12 20:43, Bernd wrote:
> 2012/9/25 patspiper <patspiper at 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.
Thanks for the feedback. Submitted as:
http://bugs.freepascal.org/view.php?id=22979

Stephano



More information about the fpc-pascal mailing list