[fpc-pascal] Conversion between ordinals and pointers is not portable
max.vlasov at gmail.com
Wed Mar 2 11:38:00 CET 2011
On Wed, Mar 2, 2011 at 12:33 PM, Jonas Maebe <jonas.maebe at elis.ugent.be>wrote:
> On 02 Mar 2011, at 09:02, Roland Turcan wrote:
>> p := PByteArray (PtrUInt (@FData.Content) + MOffset);
>> But the compiler informs about %subj%.
>> How to get rid of this warning and to make code portable?
> Typecast to PByte instead of to PtrUInt.
If Roland wants to keep compatibility with Delphi for some reasons, I
suggest using something like
AddrInt = PByte;
AddrInt = integer;
if this approach is used the line
PByteArray (AddrInt(@FData.Content) + MOffset)
should not lead to any question both from fpc and Delphi
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal