[fpc-pascal] Advanced note: local variable "i" is assigned but never used?

Vojtěch Čihák vojtech.cihak at atlas.cz
Tue Feb 20 13:51:36 CET 2018


Hello,
 
would it be possible to do more advanced checking of this note? This code
 
var i: Integer;
begin
  i:=5;
end;        
 
gives Note: Local variable "i" is assigned but never used
 
var i: Integer;
begin
  i:=5;
  writeln('i ', i);
end;        
 
is OK
 
var i: Integer;
begin
  i:=5;
  writeln('i ', i);
  i:=7;
end;       
 
The last example is also accepted. It would be nice to have Note: Local variable "i" is assigned but never used too.
 
Thanks,

Vojtěch a.k.a. Blaazen



More information about the fpc-pascal mailing list