> > Gerhard Scholz wrote: > > > >> > >>Inc ( v, i ) and Dec ( v, i ) produce rangecheck or overflow check with > >> {$r+,q+} > >> > >>Without checks the program runs corrctly. > > Fixed > > > <snip> > > This looks similar to bug 4152 that I submitted recently. > > 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.
For cardinal IMHO not-a-bug? _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel