[fpc-pascal] Range checks
svaa at ciberpiula.net
Mon Jan 29 21:04:37 CET 2018
El 27/01/18 a las 15:10, C Western escribió:
> The following innocuous looking code generates a range check error:
> function Count: qword;
> Result := 0;
> i: Integer;
> for i := 0 to Count-1 do
> I can (more or less) see why, but it means that I can't (for example)
> compile the Cocoa widget set in 64 bit with bounds checking on, as
> then qword seems to be used as a count for, for example, NSarray.
> Am I missing something?
The problem is that count is qword, so the operation is qword until it
needs to convert it
for i:=0 to integer(qword( qword(count) - qword(1)) do
for i := 0 to *integer*(Count)-1 do
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal