[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.2 v2] hw/i386/acpi-build: Fix maybe-uninitialized error
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH-for-5.2 v2] hw/i386/acpi-build: Fix maybe-uninitialized error when ACPI hotplug off |
Date: |
Sun, 8 Nov 2020 18:10:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 |
On 11/8/20 4:58 AM, Ani Sinha wrote:
> On Sun, Nov 8, 2020 at 1:10 AM Philippe Mathieu-Daudé <philmd@redhat.com>
> wrote:
>>
>> GCC 9.3.0 thinks that 'method' can be left uninitialized. This code
>> is already in the "if (bsel || pcihp_bridge_en)" block statement,
>> but it isn't smart enough to figure it out.
>>
>> Restrict the code to be used only in the "if (bsel || pcihp_bridge_en)"
>> block statement to fix (on Ubuntu):
>>
>> ../hw/i386/acpi-build.c: In function 'build_append_pci_bus_devices':
>> ../hw/i386/acpi-build.c:496:9: error: 'method' may be used uninitialized
>> in this function [-Werror=maybe-uninitialized]
>> 496 | aml_append(parent_scope, method);
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> cc1: all warnings being treated as errors
>
> OK I looked at the patch closely and it makes sense. Can you please
> run a "make check" to make sure we have not broken anything?
Yes I did...