DFA gives bogus message about "var" parameter of type "Text" not being initialized
Original Reporter info from Mantis: Hixie
-
Reporter name: Ian Hickson
Original Reporter info from Mantis: Hixie
- Reporter name: Ian Hickson
Description:
In the following example, the compiler complains that the variable F might not be initialised, even though it's a "var" parameter. The same error does not seem to occur for parameters that are ordinals or AnsiStrings.
{$MODE OBJFPC}
{$OPTIMIZATION DFA}
{$HINTS ON}
program test;
procedure TestText(var F: Text);
begin
Writeln(F, 'Test'); // Hint: Local variable "F" does not seem to be initialized
end;
begin
TestText(Output);
end.
Mantis conversion info:
- Mantis ID: 25916
- OS: Debian
- Build: trunk 2014/03/18
- Platform: x86_64
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 29289 (#f1eb00a4)
- Target version: 2.7.1