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

Hans-Peter Diettrich DrDiettrich at compuserve.de
Thu Jul 7 16:16:56 CEST 2005


Marcel Martin wrote:

> I think Marco is right. Basically, when the compiler has to
> code Inc(x,SomeConstant), the only sensible behaviour it is
> expected to have is to regard the constant as being of the
> type of x. So, if x is a Longword and if SomeConstant equals
> -1, either it adds $ffffffff (and there will be an overflow
> if x > 0) or it stops at compile time saying that -1 is not
> a Longword.

IMO the compiler can convert between Inc and Dec, for negative
constants, so that the value always is positive, compatible with
signed and unsigned data types.

DoDi






More information about the fpc-devel mailing list