Re: [PATCH] hw/i386: changes towards enabling -Wshadow=local

2023-09-25 Thread Ani Sinha
> On 25-Sep-2023, at 8:42 PM, Peter Xu wrote: > > On Sat, Sep 23, 2023 at 08:03:34AM +0530, Ani Sinha wrote: >> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c >> index c0ce896668..c1fb69170f 100644 >> --- a/hw/i386/intel_iommu.c >> +++ b/hw/i386/intel_iommu.c >> @@ -3770,9 +3770,9

Re: [PATCH] hw/i386: changes towards enabling -Wshadow=local

2023-09-25 Thread Peter Xu
On Sat, Sep 23, 2023 at 08:03:34AM +0530, Ani Sinha wrote: > diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c > index c0ce896668..c1fb69170f 100644 > --- a/hw/i386/intel_iommu.c > +++ b/hw/i386/intel_iommu.c > @@ -3770,9 +3770,9 @@ static void vtd_address_space_unmap(VTDAddressSpace > *a

Re: [PATCH] hw/i386: changes towards enabling -Wshadow=local

2023-09-25 Thread Daniel P . Berrangé
On Sat, Sep 23, 2023 at 08:03:34AM +0530, Ani Sinha wrote: > Code changes 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 >

[PATCH] hw/i386: changes towards enabling -Wshadow=local

2023-09-22 Thread Ani Sinha
Code changes 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. CC: Markus Armbruster CC: Philipp