[Lazarus] [fpc-devel] win64 dwarf patch

Steve Smith stevie at collector.org
Sat Oct 16 17:58:32 CEST 2010


Message: 6
Date: Sat, 16 Oct 2010 16:34:01 +0200 (CEST)
From:  <michael at freepascal.org>
Subject: Re: [Lazarus] [fpc-devel] win64 dwarf patch
To: Lazarus mailing list <lazarus at lists.lazarus.freepascal.org>
Message-ID: <alpine.DEB.2.00.1010161630250.13590 at home.telenet.be>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed



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!




More information about the Lazarus mailing list