On 11/25/15 18:41, Ard Biesheuvel wrote:
> On 25 November 2015 at 17:35, Cohen, Eugene <eug...@hp.com> wrote:
>> Small warning fix.
>>
> 
> Hello Eugene,
> 
> Presumably, the warning is about the variable potentially being used
> uninitialized?
> If so, please drop the cast in the initializer, and update your
> $subject accordingly.
> 
> I am not sure (cc'ing Laszlo since he probably knows from the top of
> his head) whether the initialization should be separate from the
> declaration, or does that apply only to structs?

In fact I started writing an email that initialization of variables with
automatic storage duration (= "locals") was not permitted; but then I
decided that I needn't be a smart-ass about everything. :)

But, since you've asked: yes, a separate assignment is necessary.

Thanks :)
Laszlo

> 
> Thanks,
> Ard.
> 
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Eugene Cohen <eug...@hp.com>
>> ---
>>  .../Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c   | 2 
>> +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git 
>> a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c 
>> b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
>> index 1dfc740..58aca5d 100644
>> --- 
>> a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
>> +++ 
>> b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
>> @@ -85,7 +85,7 @@ AllocatePagesFromList (
>>  {
>>    EFI_STATUS       Status;
>>    LIST_ENTRY      *Link;
>> -  FREE_PAGE_NODE  *Node;
>> +  FREE_PAGE_NODE  *Node = (FREE_PAGE_NODE *)NULL;
>>    FREE_PAGE_NODE  *NewNode;
>>    UINTN            AlignmentMask;
>>    EFI_PHYSICAL_ADDRESS Memory;
>> --
>>

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to