<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">Ondrej Pokorny <<a href="mailto:lazarus@kluug.net">lazarus@kluug.net</a>> schrieb am Di., 3. Juli 2018, 22:57:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 03.07.2018 22:08, Florian Klämpfl wrote:<br>
> Am 03.07.2018 um 21:30 schrieb Ondrej Pokorny:<br>
>> On 03.07.2018 20:54, Florian Klämpfl wrote:<br>
>> program Project1;<br>
>> type<br>
>>    TMyArray = array[0..10] of Integer;<br>
>>    procedure Init2(var A: TMyArray);<br>
>>    begin<br>
>>      A[2] := 1;<br>
>>    end;<br>
>> var<br>
>>    A: TMyArray;<br>
>> begin<br>
>>    Init2(A);<br>
>> end.<br>
>><br>
>> should not emit the warning because A is not being read in Init2.<br>
><br>
> (please note it throws only a hint in this case as A *is* initialized <br>
> as it is a global variable).<br>
><br>
> FPC has no global data flow analysis (and I do not plan to do so yet), <br>
> so this is warning is currently far out of reach.<br>
<br>
Doing it for SetLength/FillChar would be a good start.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">As Florian already wrote: FillChar() is nothing special. It's merely an ordinary procedure with an untyped var parameter. The compiler can't make any assumptions about what the code inside is doing with the parameter. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>