On 26 Sep 2013, at 16:21, Carsten Bager wrote:

Here is output from the 2.4.5 Compiler and the 2.62 compiler. of the following program
compiled the same way.

It has always been possible to eliminate runtime checking when incrementing a byte/word in
this way (if one wants the byte to roll over).

At least http://www.freepascal.org/docs-html/ref/refsu5.html states that it should generate a range check error, and so does http://delphi.about.com/od/objectpascalide/l/aa012500a.htm ("Note: If we try to use Succ when at the last element Delphi will generate a run-time exception if the range checking is on.")

This is not possible with the 2.6.2 compiler. Is there a reason for this.

The implementation of succ() may have been internally remapped on top of another primitive which already had support for range checking. I don't think it was a conscious decision, but it does seem correct to me.


Jonas
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to