[fpc-devel] What means -Oodfa ?

Juha Manninen juha.manninen62 at gmail.com
Sun Mar 22 15:53:18 CET 2015

There are some false positive warnings.
For example this construct can be found in Lazarus IDE code frequently.

 function IDEDirectiveNameToDirective(const DirectiveName: string):
   for Result:=Low(TIDEDirective) to High(TIDEDirective) do
     if CompareText(IDEDirectiveNames[Result],DirectiveName)=0 then exit;

Compiled with -Oodfa gives :
 buildfiledlg.pas(406,44) Warning: Function result variable does not
seem to initialized
which is wrong.

There are also thousands of hints about variable "$self" that make no
sense to me, like :
 initialsetupdlgs.pas(563,27) Hint: Variable "$self" does not seem to
be initialized
How does the compiler come to that conclusion?


More information about the fpc-devel mailing list