[fpc-devel] Redefine FillChar() to use out parameter instead
Graeme Geldenhuys
graeme at mastermaths.co.za
Tue Nov 17 12:04:07 CET 2009
Hi,
I asked a question about a compiler hint in the fpc-users mailing list.
As JoshyFun suggested, is it not maybe better to change FillChar()
definition so first parameter is a out parameter - to prevent
unnecessary compiler hint in code?
-------- Original Message --------
Subject: Re: [fpc-pascal] How to solve "variable does not seem to be
initialized" compiler hint.
Date: Tue, 17 Nov 2009 11:45:39 +0100
From: JoshyFun <joshyfun at gmail.com>
Reply-To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
To: Graeme Geldenhuys <graemeg at opensoft.homeip.net>, FPC-Pascal users
discussions <fpc-pascal at lists.freepascal.org>
References: <4B0274EA.3000100 at mastermaths.co.za>
Hello Graeme,
Tuesday, November 17, 2009, 11:03:22 AM, you wrote:
GG> /home/graemeg/programming/3rdParty/DCPcrypt/dcpblockciphers.pas(229,16)
GG> Hint: Local variable "Temp" does not seem to be initialized
[...]
GG> raise EDCP_blockcipher.Create('Cipher not initialized');
GG> p1:= @Indata;
GG> p2:= @Outdata;
Insert this, or in other words "use it". The reason is that "fillchar"
first parameter is "var" instead "out".
Temp[0]:=0;
GG> FillChar(Temp, SizeOf(Temp), 0); // <-- I added this to no affect
GG> for i:= 1 to Size do
Best regards,
JoshyFun
--------------------------------------
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/
More information about the fpc-devel
mailing list