[fpc-pascal] Range checking in a for loop

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Oct 25 14:08:16 CEST 2010


On 25 Oct 2010, at 13:54, Jonas Maebe wrote:

> On 25 Oct 2010, at 13:24, David W Noon wrote:
>
>> Try declaring
>>  i : 1..3;
>> instead, as that range matches the array's bounds.  You should then  
>> get
>> a range check at compile time.
>
> With current released versions, you won't get such a compile time  
> error.

... if range checking is disabled (then you'll only get a warning).  
When range checking is enabled, you do get an error already.

> I fixed that just yesterday in svn though (r16213).

and now you get an error under all circumstances (common sense and  
Delphi-compatible).


Jonas



More information about the fpc-pascal mailing list