View Revisions: Issue #38103

Summary 0038103: False "variable uninitialized" compiler warning in boolean evaluation with -O3
Revision 2020-11-19 09:36 by Ondrej Pokorny
Description Compiling with -O3, the following code emits a warning:

// function MyOut(out S: string): Boolean;
if MyOut(S) and (S<>'') then
// Warning: Variable "S" of a managed type does not seem to be initialized

Boolean evaluation is always guaranteed to execute from left to right, therefore S must be initialized after MyOut() execution.
Revision 2020-11-19 09:34 by Ondrej Pokorny
Description Compiling with -O3, the following code emits a warning:

// function MyOut(out S: string): Boolean;
if MyOut(S) and (S<>'') then

Boolean evaluation is always guaranteed to execute from left to right, therefore S must be initialized after MyOut() execution.