Maybe just add an annotation in TComponent documentation to make this problem clear.

Something like that:

"Tag property is a streamed integer value. Using Tag as pointer storage is bad programing practice and produce a lot of problems in 64 bit compilation (where Tag is still 32bit integer and pointers are 64bit)."

http://lazarus-ccr.sourceforge.net/docs/rtl/classes/tcomponent.tag.html

Greetings
Andrzej And3mD Kilijański

Dnia 17-10-2010 o 15:12:19 Marco van de Voort <[email protected]> napisał(a):

On Sat, Oct 16, 2010 at 02:32:12PM +0200, And3mD wrote:
OK, I understand. The terrible thing is that I saw using Tag as Pointer in
some delphi books.

That's implicate a lot of code with Tag as pointers. Maybe adding non
streamed TagPtr:PtrInt will be the best compromise?

While possible, I don't think it is necessary. This is bad coding that
should have cleaned up long ago. Adding a workaround because the bad
workaround fails makes no sense. The old workaround should be cleaned up.

Of course there is always a chance that Embarcadero will do something like
that when they go 64-bit, but we'll cross that bridge if we get there.
(since even if we add a workaround, there is a chance they will add yet
another)

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to