[fpc-pascal] Initialization of packed record local variables?

Michael Van Canneyt michael at freepascal.org
Mon Jul 18 21:52:37 CEST 2016



On Mon, 18 Jul 2016, Bo Berglund wrote:

> I am getting compile hints "Local variable "<variable name>" does not
> seem to be initialized" for a number of variables of packed record
> type.
>
> Does not the FPC compiler reserve and zero the memory area of such
> variables?

No.


> In any case I am using Move() to fill the variables with data from a
> binary buffer, maybe the compiler is not smart enough to detect this
> and remove the warning?

The compiler has no way of knowing if your move statement initializes the
full record.

Michael.



More information about the fpc-pascal mailing list