This is a dumb mistake, but I wonder if FPC should issue an error when it occurs? (Or perhaps it DOES issue one if you have the compiler switches set correctly, and I don't?)
procedure foo(n: integer);
var i: byte;
begin
for i := 0 to N do <something>;
end;
If the argument N >255, the for--to--do statement seems to simply not execute at all, with no warning to let you know that the variable i really needs to be an integer, not a byte.
Does range checking turned on catch this?