[fpc-pascal] How to solve "variable does not seem to be initialized" compiler hint.

Graeme Geldenhuys graeme at mastermaths.co.za
Tue Nov 17 11:03:22 CET 2009


Hi,

And how do I solve this compiler hint?  Normally I use FillChar(), but
here it made no difference. The hint no simply moved to the line
containing FillChar() call. :-(


/home/graemeg/programming/3rdParty/DCPcrypt/dcpblockciphers.pas(229,16)
Hint: Local variable "Temp" does not seem to be initialized


-------------------------------
procedure TDCP_blockcipher64.DecryptCFB8bit(const Indata; var Outdata;
    Size: longword);
var
  i: longword;
  p1, p2: Pbyte;
  TempByte: byte;
  Temp: array[0..7] of byte;
begin
  if not fInitialized then
    raise EDCP_blockcipher.Create('Cipher not initialized');
  p1:= @Indata;
  p2:= @Outdata;
  FillChar(Temp, SizeOf(Temp), 0); // <-- I added this to no affect
  for i:= 1 to Size do
  begin
    TempByte:= p1^;
    EncryptECB(CV,Temp);          // <- original hint was here
    p2^:= p1^ xor Temp[0];
    Move(CV[1],CV[0],8-1);
    CV[7]:= TempByte;
    Inc(p1);
    Inc(p2);
  end;
end;
-------------------------------



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/




More information about the fpc-pascal mailing list