[fpc-devel] succ(byte)

Sven Barth pascaldragon at googlemail.com
Thu Sep 26 17:18:41 CEST 2013


On 26.09.2013 17:13, Jonas Maebe wrote:
>
> 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.

Ehm... Jonas... it was a conscious decision by you. ^^ (see 
http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=15474 )

Regards,
Sven



More information about the fpc-devel mailing list