...
> Bug 4152 is partly fixed. The compiletime error is removed. Only the
> runtime overflow is left. That still needs to be decided how to handle it.
> The following code also fails with an overflow
> 
> {$Q+}
> var
>   v : cardinal;
> begin
>   v:=100;
>   inc(v,-1);
> end.
> 
> The reason is that -1 is in fact an addition of $ffffffff resulting in the
> carry flag being set and therefor an overflow.

Maybe the cleanest way is (in the $r+ $q+ mode) to handle 
    inc ( v, d ) ;
the same as 
   v := v + d ;

I replaced my code like this when I found the bug, and now my code works.

Gerhard

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to