You are not logged in.
I'm confused a little. In mORMot there are many places with a code like
Result := Pointer(PtrUInt(Dest)+bytesShift)
In this case FPC gives a hint "Conversion between ordinal and pointers is not portable", and "real" hints are lost between it.
I try to replace PtrUInt by PByte, this is more clear IMHO and FPC become happy, but in this case Delphi 7 fails to compile.
From other side, Delphi 7 know about PAnsiChar pointer arithmetic, so may be
Result := PAnsiChar(Dest)+bytesShift
is a solution? Or there is some hidden stones in this?
Offline
FPC is pessimistic about PtrUInt(Dest)+... since it will work seamlessly on i386 and x86-64 CPUs, and also ARM.
On some other targets (which don't support yet), it may be unsafe.
PAnsiChar(Dest) will make an hidden call to some RTL function is Dest is an AnsiString.
So it is not a silver bullet either.
Perhaps it may be safe to disable this particular hint for FPC (in Synopse.inc), in the scope of our units.
Offline
Thanks for explanation! If there is no silver bullet let's live with hints while we support Deplhy7. In case we (you) decide to stop support D7 in flavor of FPC we can replace it by PByte...
Offline