[fpc-pascal] New Warnings with fpc >= 3.2.0
stdreamer
stdreamer at freemail.gr
Thu Mar 12 14:31:33 CET 2020
On 11/3/2020 12:15 μ.μ., fredvs via fpc-pascal wrote:
> Hello.
>
> Compiling that code with fpc 3.2.0 gives the warning that follows:
>
> ---> if (kind <> tabulatorkindty(-1)) --> gives now the warning:
>
> "msedrawtext.pas(1115,48) Warning: range check error while evaluating
> constants (-1 must be between 0 and 3)"
>
> tabulatorkindty is declared as:
>
> ---> tabulatorkindty = (tak_left,tak_right,tak_centered,tak_decimal);
>
> So, if I understand ok, with new feature of fpc, "-1" is no more permitted.
>
> What must be changed, a new constant should be added at end of the array,
> something like:
>
> ---> tabulatorkindty = (tak_left,tak_right,tak_centered,tak_decimal,
> tak_none);
>
> ?
>
> And then use:
>
> ---> if (kind <> tabulatorkindty(tak_none) ?
>
> Or do you have a other idea?
>
> Thanks.
>
> Fre;D
>
>
>
Do it the other way around ee
if (integer(kind) <> -1) then
which will make it always true. I see no reason for that "if" to exists
at least not with out the code.
More information about the fpc-pascal
mailing list