[fpc-pascal] Initialization of packed record local variables?
Bo Berglund
bo.berglund at gmail.com
Mon Jul 18 22:19:34 CEST 2016
On Mon, 18 Jul 2016 21:52:37 +0200 (CEST), Michael Van Canneyt
<michael at freepascal.org> wrote:
>> Does not the FPC compiler reserve and zero the memory area of such
>> variables?
>
>No.
Does thios mean that the memory is reserved but not cleared or does it
mean that memory is not reserved at all?
>
>> 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.
>
Well, if it has no way of knowing that the record is stuffed with data
then why does it issue a notice that it seems uninitialized?
Are there other commands it does detect as initialization of the
variable?
--
Bo Berglund
Developer in Sweden
More information about the fpc-pascal
mailing list