Hallo fredvs,

Du schriebst am Wed, 16 Jun 2021 14:33:02 -0700 (MST):

> For example, that code produce the warning pointing to ptruint:
> > Conversion between ordinals and pointers is not portable.
> 
> procedure tpointeransistringhashdatalist.add(const keys: array of
> string; startindex: pointer = pointer($00000001));

Nice cast. This _will_ cause a hard crash on a dereference attempt on
most machines. Maybe that's intended, though...
(Well, it might even work on '86 style machines, though, as these are
still 8-bit based yet.)
...
>   add(keys[ca1],pointer(ca1+ptruint(startindex)));
...
> I am using Linux 64 bit and changed in msetypes.pas
> 
> {$ifdef cpu64}
> PtrUInt = QWord;
> {$else}
> PtrUInt = DWord;
> {$endif}
> 
> But still the warning.

You're _certain_ that the compiler "understands" the conditional
construct?
I'd assume that it doesn't even try to evaluate it, but just find a
type definition that may not comply for some of the supported
architectures, which is the condition that triggers the warning.

> Where is the guilty?

Don't know - just can assume that it's caused by overblown expectations
as to the intelligence of a simple code converter, aka compiler.

-- 
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
-----------------------------------------------------------
Mit freundlichen Grüßen, S. Schicktanz
-----------------------------------------------------------



_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to