[Lazarus] [fpc-devel] win64 dwarf patch

Michael Van Canneyt michael at freepascal.org
Sat Oct 16 21:06:11 CEST 2010



On Sat, 16 Oct 2010, Steve Smith wrote:

> On Sat, 16 Oct 2010, Michael Van Canneyt wrote:
>>> CstomData: packed record
>>>      case integer of
>>>        0 : (i64: int64);
>>>        1 : (lo32, hi32 : Cardinal);
>>>        2 : (Words : Array[0..3] of Word);
>>>        3 : (Bytes : Array[0..7] of Byte);
>>>        4 : (p : pointer);
>>>        5 : (obj : TObject);
>>>   end;
>> You just invented a Variant type.
>
> Hardly, It's a variant record and has been around since at
> least Turbo Pascal 3.0 20 years ago!  Variant types include
> logic to prevent you from performing inappropriate operations
> on typed data.  This contains no logic at all.
>
>> Indeed, and the whole point is to have a type-safe solution.
>
> It isn't Type-Safe, it's exactly the opposite.  It's a way of fooling
> the compiler into performing Pointer operations on an array of
> Char for example.  Again, this was possible in TP3, it's called
> TypeCasting.  If we want to access CustomData as a 64 bit integer
> then use int64(CustomData), everyone (should) know what this
> does.  Either that or declare CustomData as "Variant"
>
> It's a shame that you decry the use of Tag as a pointer and then
> seem to offer your implicit support to nonsense like this!

I'm not supporting anything. I think tag should remain as it is,
for Delphi compatibility.

If you read all my mails, you would have understood that I'm not 
at all convinced we must offer anything else, so "support to nonsense" ? 
Far from it.

Michael.




More information about the Lazarus mailing list