Am 24.03.2020 um 01:08 schrieb fredvs via fpc-pascal:
Hello.
With fpc 3.3.1 there is this warning:
"Warning: (4110) Range check error while evaluating constants (-193 must be
between 0 and 255)"
Here the code pointed by the warning:
const
foldhiddenbit = 7;
foldhiddenmask = 1 shl foldhiddenbit;
currentfoldhiddenbit = 6;
currentfoldhiddenmask = 1 shl currentfoldhiddenbit;
foldlevelmask = byte(not (foldhiddenmask or currentfoldhiddenmask));
-------->Here the warning
I dont understand how the compiler can find -193 as value for
foldlevelmask...
Splitting the last constant a bit more allows to find the culprit:
=== code begin ===
const
const1 = foldhiddenmask or currentfoldhiddenmask;
const2 = not const1;
const3 = byte(not const2);
=== code begin ===
The compiler will now complain on const3 (and a check with SizeOf(...)
reveils that const2 is not of Byte size). I'll have to investigate
however why the "not" behaves as it does.
Regards,
Sven
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal