[fpc-devel] bug: Inc(v,i)/Dec(v,i)

Peter Vreman peter at freepascal.org
Fri Jul 8 18:31:51 CEST 2005

>>   v:=v+-5;
> I'm sorry, v IS unsigned, delta IS signed, and the computation has to be
> done. Besides, v and d are 8-bit or 16-bit, and the result WILL fit in v
> (that is checked before for other reasons).

Range check errors are inserted only at assignment. Within the expression
at the right side the value can be bigger/smaller than what is allowed.
The compiler even doesn't know the type of the final destination at that
time. And in pascal the rule is to do the calculations in the native
integer type. That means 32 bit (or 64 bit for amd64).

More information about the fpc-devel mailing list