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

Fantomas fantomaspda at yandex.com
Tue Nov 17 12:15:11 CET 2009

Hello, Graeme!

Tuesday, November 17, 2009, 1:03:22 PM, you wrote:

> 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

>   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;

That compiler hint appears because you have not assigned a value to the variable
Temp before passing it to a function as a parameter. You can pay no attention to
that hint or switch off hints in your code where the hint is produced, if it
really bothers you.

Best regards,

More information about the fpc-pascal mailing list