[fpc-pascal] Warning "Local variable seems to be not initialized" on dyn array
Jürgen Hestermann
juergen.hestermann at gmx.de
Mon Mar 9 17:49:01 CET 2015
Am 2015-03-09 um 17:40 schrieb Jonas Maebe:
>
> On 09 Mar 2015, at 17:25, Jürgen Hestermann wrote:
>
>> I get a warning that a local dynamic array variable is not initialized.
>> Aren't such managed types initialized by default?
>> On http://wiki.freepascal.org/Dynamic_array it says:
>>
>> Actually, dynamic arrays are pointers with automatic dereferencing. They are initialized to *nil* automatically.
>>
>> So why the warning?
>
> http://bugs.freepascal.org/view.php?id=24601#c75617 (and the comment below + use -vq to see warning numbers, and -vmXXXX to block a particular warning number).
>
>
Thanks for the answer.
But still: Why is there such a warning for managed types at all?
Dynamic arrays are initialized by default so the warning text is simply wrong.
It IS initialized and the compiler knows this.
More information about the fpc-pascal
mailing list