[fpc-pascal] Initializing records and other complicated structures
hakkie42 at gmail.com
Mon Sep 27 10:26:45 CEST 2010
Fpc sometimes complains (hints) about local variables not being initialized.
My question: how do I initialize more complicated structures like
records? And should I need to (I'm guessing no in the example below, but
the contents of the record will be undefined - no problem as there are
no pointers/strings in there)?
TIfdTag = packed Record
//Offset / Value
in code somewhere
As TIfdTag seems to contain non-pointer records only, I thought I could
use Sizeof and tried this:
FillByte(tag, SizeOf(tag), 0); //initialize var.
The compiler warning doesn't go away though.
Is this the recommended way of doing things?
More information about the fpc-pascal