[fpc-devel] Unexpected "Range check error while evaluating constants" when compiling for Win64

Michael Van Canneyt michael at freepascal.org
Mon Feb 13 09:10:06 CET 2023



On Mon, 13 Feb 2023, Ondrej Pokorny via fpc-devel wrote:

> On 12.02.2023 23:08, Bart via fpc-devel wrote:
>> On Sun, Feb 12, 2023 at 10:47 PM Jonas Maebe via fpc-devel
>> <fpc-devel at lists.freepascal.org> wrote:
>> 
>>> Afaik it's because "default" doesn't support qword values, iirc because
>>> of (at least old) Delphi compatibility.
>> OK, I removed the "default".
>> 
>> Theoretically would that lead to problems when storing the value in
>> lfm and reading it back using different bitness versions of Lazarus?
>> Should I even publish such a property?
>> (I don't think Lazarus has a property editor for HKEY...)
>
> I wouldn't publish the HKEY property but create an own enumeration for it:
>
> TRegKey = (rgClassesRoot, rgCurrentUser, ....)
>
> and publish this instead. Pro: you can put only valid values into the 
> property and object inspector shows you nice enum names instead of strange 
> integers.
>
> Then make a simple transformation to HKEY:
>
> RegKeyToHKey: array[TRegKey] of HKEY = (HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, 
> ...);

Yes, I also think this is the best solution...

Michael.


More information about the fpc-devel mailing list