hw/acpi: changes towards enabling -Wshadow=local
commit7b393b71424ba105f2b1c5f2c49f8d8710ad00eb
authorAni Sinha <anisinha@redhat.com>
Fri, 22 Sep 2023 12:42:02 +0000 (22 18:12 +0530)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 29 Sep 2023 08:07:18 +0000 (29 10:07 +0200)
tree02e67f8160cfe31d2e115f4925ad8ef9996a0077
parentd8573092a49b3133530ceee35846a54e600f8a73
hw/acpi: changes towards enabling -Wshadow=local

Code changes in acpi that addresses all compiler complaints coming from enabling
-Wshadow flags. Enabling -Wshadow catches cases of local variables shadowing
other local variables or parameters. These makes the code confusing and/or adds
bugs that are difficult to catch.  See also

    Subject: Help wanted for enabling -Wshadow=local
    Message-Id: <87r0mqlf9x.fsf@pond.sub.org>
    https://lore.kernel.org/qemu-devel/87r0mqlf9x.fsf@pond.sub.org

The code is tested to build with and without the flag turned on.

CC: Markus Armbruster <armbru@redhat.com>
CC: Philippe Mathieu-Daude <philmd@linaro.org>
CC: mst@redhat.com
CC: imammedo@redhat.com
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Message-ID: <20230922124203.127110-1-anisinha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
hw/acpi/cpu_hotplug.c
hw/i386/acpi-build.c
hw/smbios/smbios.c