[Lazarus] Note: Local variable "$defaultbufpos" not used

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jul 16 08:45:26 CEST 2010


On Fri, 16 Jul 2010 01:47:56 +0200
Bernd <prof7bit at googlemail.com> wrote:

> procedure analyzeHistory(...a lot of arguments...); stdcall;
> var
>   i:       LongInt;
>   bufpos:  LongInt = 0;
>   balance: Double = 0;
>   curtime: LongInt;
> 
> begin
>    [...]
> 
> I did a lot of C in the last 6 months and almost no pascal.
> 
> I'm not really sure anymore if i am confusing something or what is
> going on. The above will compile fine, except some little notes
> 
> Note: Local variable "$defaultbufpos" not used
> Note: Local variable "$defaultbalance" not used
> 
> Somewhere I have read (and I could swear I did it already) that this
> is the syntax to initialize a variable. I just had a session of over
> an hour and dozens of crashes because bufpos is an index into some
> complicated array that comes via the argument list from another
> application that takes over a minute until it is restarted after such
> a crash (this is no fun) and I really searched everywhere, the only
> thing I didn't consider until the very end was that bufpos might not
> be initialized.
> 
> It will not be initialized. Is this a bug or a feature?

Please create a bug report. Not for lazarus, on the fpc bug tracker.
Include all the information you gave here.

Mattias




More information about the Lazarus mailing list