[fpc-pascal] Range check error warning.
Gerhard Scholz
gs at g--s.de
Tue Mar 24 20:39:34 CET 2020
what about
foldlevelmask = (not (foldhiddenmask or currentfoldhiddenmask)) and $ff ;
instead of the " f... := byte(...) " line
?
----- Original Message -----
From: "fredvs via fpc-pascal" <fpc-pascal at lists.freepascal.org>
To: <fpc-pascal at lists.freepascal.org>
Cc: "fredvs" <fiens at hotmail.com>
Sent: Tuesday, March 24, 2020 1:08 AM
Subject: [fpc-pascal] Range check error warning.
> 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...
>
> Fre;D
>
>
>
>
>
>
>
> -----
> Many thanks ;-)
> --
> Sent from: http://free-pascal-general.1045716.n5.nabble.com/
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
More information about the fpc-pascal
mailing list