[fpc-devel] vtCardinal in TVarRec

Jonas Maebe jonas at freepascal.org
Sun Sep 29 11:50:30 CEST 2019

On 2019-09-29 11:31, Kirinn wrote:
> I'd like to ask for some clarification on this issue:
> https://bugs.freepascal.org/view.php?id=32135
> Dwords can't be passed into an array of const, because TVarRec doesn't
> have an unsigned 32-bit integer type. Adding any kind of handling for
> it would be Delphi-incompatible. But isn't the point of the ObjPas
> mode to be able to fix regrettable oversights that Delphi has? Can't a
> special case be added for accepting Dwords in ObjPas mode only?

That is generally only possible if such a change is confined to the unit 
compiled in (Obj)FPC mode. Otherwise the interoperability between code 
written in different modes –which can be several layers deep, of which 
you as "top level" user may have no idea– becomes a matter of luck (or 
being extremely careful and having the source code of everything 
available, or at least information about the mode the code was written 

> Note,
> that vtQWord and vtUnicodeString are already extensions going beyond
> Delphi. Why not Dword?

FPC supported an unsigned 64 bit integer type before Delphi did, so at 
the time vtQWord was added, there was no Delphi behaviour to be 
compatible with. When Delphi later introduced an unsigned 64 bit integer 
type but no vtQWord, the choice was between breaking backward 
compatibility with existing FPC code or keeping an incompatibility with 
Delphi. In such no-win situations, we generally opt for keeping FPC 

And at least current versions of Delphi also support vtUnicodeString.


More information about the fpc-devel mailing list