[fpc-devel] Component FTag and Tag should be int64

Dimitri Smits smitco at telenet.be
Mon Nov 22 16:40:19 CET 2010

----- "michael vancanneyt" <michael.vancanneyt at wisa.be> schreef:

> On Mon, 22 Nov 2010, Andrew Brunner wrote:
> > I was looking at the code for Tag property in classes unit and
> noticed I can't safely use Tag to keep runtime pointers (at least on a
> 64 bit compile). What is the likelihood of getting tags changed to
> support universal access under 64/32 bit compiles?
> >
> > What is the logic behind the shortfall? I suspect just legacy and it
> could be easily fixed.
> _______________________________________________
> The logic is that it is bad programming to use an integer to store a
> pointer.
> And we don't want to encourage bad programming.
> Yes, I know it's easy, and yes I know it's common practice. 
> Neither make it right to do so.


Never EVER fall into the VB bullshit trap that is the Tag property. Related to that matter, Windows/delphi has a few of these "Data pointers", especially the stuff that is lower-level and is used to invoke the winapi with as a parameter (callbacks anyone?). Always try to stay clear of it as much as possible, because it does encourage and even invite bad programming.

> We'll fix the issue as the upcoming Delphi 64-bit - unfortunately -
> forces us 
> to follow suit.

sad to read this part though...

kind regards,
Dimitri Smits

More information about the fpc-devel mailing list