[fpc-devel] bug: Inc(v,i)/Dec(v,i)
Marco van de Voort
marcov at stack.nl
Fri Jul 8 08:20:22 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.
It's not a matter of what can, but what should.
More information about the fpc-devel
mailing list