[fpc-pascal]compiler bug?

Florian Klaempfl Florian.Klaempfl at gmx.de
Mon Jan 6 12:31:44 CET 2003


Peter Vreman wrote:
> The following program compiles but crashes with an integer range error
> when it gets to the comparison:
> 
> {$R+}
> var
>   a : cardinal;
>   b : longint;
> begin
>   a := 0;
>   b := -1;
>   if a > b then writeln ('OK');
> end.
> 
> Am I missing something, or is this a compiler bug?
> 
> 
> This is a bug. Added it as tb0447 to the testsuite.
> 

It isn't considered as a bug in 1.0.x, see also my message about the warning.

> Workaround is to use int64(a) in the comparison






More information about the fpc-pascal mailing list