Wrong hint about local variable assigned but not used
Original Reporter info from Mantis: Mattias @lazidealist
-
Reporter name: Mattias Gaertner
Original Reporter info from Mantis: Mattias @lazidealist
- Reporter name: Mattias Gaertner
Description:
Compiler svn rev 21103 emits wrong hint.
demo.pas(10,6) Note: Local variable "l" is assigned but never used
There is no hint with an older fpc 2.7.1.
Steps to reproduce:
program demo;
{$mode objfpc}{$H+}
uses
Classes, SysUtils;
function DoSomething(AName: string): integer;
var
i, l: Integer;
begin
Result := 0;;
l := Length(AName);
for i:= 1 to Paramcount do begin
if copy(ParamStr(i),1, l) = AName then
inc(Result);
end;
end;
begin
DoSomething('a');
end.
Mantis conversion info:
- Mantis ID: 21878
- Fixed in version: 3.0.0
- Fixed in revision: 21106 (#562b968b)