-Oodfa gives wrong uninitialised result for for-loop
Original Reporter info from Mantis: Jonas @jmaebe
-
Reporter name: Jonas Maebe
Original Reporter info from Mantis: Jonas @jmaebe
- Reporter name: Jonas Maebe
Description:
When compiled with -Oodfa, the following program produces a warning about a potentially uninitialised function result:
{$mode objfpc}
type
tarr = array of longint;
var
a: array of longint;
function IndexOfValue(const a: tarr; l: longint): longint;
begin
for result:=low(a) to high(a) do
if a[result]=l then
exit;
result:=-1;
end;
begin
end.