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

J. Gareth Moreton gareth at moreton-family.com
Sun Feb 12 22:04:10 CET 2023


Yeah, of course, since LongInt($80000001), before typecasting to HKEY, 
is specifically a signed constant.  So obvious!!

Kit

On 12/02/2023 20:43, Bart via fpc-devel wrote:
> On Sun, Feb 12, 2023 at 6:26 PM J. Gareth Moreton via fpc-devel
> <fpc-devel at lists.freepascal.org> wrote:
>> If HKey is unsigned, then yes, the definition should be
>> HKEY(DWORD($80000001)).  I do wonder why Win64 produces that particular
>> error though because the final destination is an unsigned 64-bit integer.
> Because QWord(some not so big negative number) = some large positive number.
>


More information about the fpc-devel mailing list