Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-09 Thread Thomas Huth
On 06/10/2023 21.08, Warner Losh wrote: On Fri, Oct 6, 2023, 11:55 AM Thomas Huth > wrote: On 06/10/2023 18.18, Thomas Huth wrote: > On 06/10/2023 16.45, Markus Armbruster wrote: >> Local variables shadowing other local variables or parameters make the

Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-09 Thread Markus Armbruster
Warner Losh writes: > On Fri, Oct 6, 2023, 11:55 AM Thomas Huth wrote: > >> On 06/10/2023 18.18, Thomas Huth wrote: >> > On 06/10/2023 16.45, Markus Armbruster wrote: >> >> Local variables shadowing other local variables or parameters make the >> >> code needlessly hard to understand. Bugs

Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-06 Thread Warner Losh
On Fri, Oct 6, 2023, 11:55 AM Thomas Huth wrote: > On 06/10/2023 18.18, Thomas Huth wrote: > > On 06/10/2023 16.45, Markus Armbruster wrote: > >> Local variables shadowing other local variables or parameters make the > >> code needlessly hard to understand. Bugs love to hide in such code. > >>

Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-06 Thread Markus Armbruster
Markus Armbruster writes: > Local variables shadowing other local variables or parameters make the > code needlessly hard to understand. Bugs love to hide in such code. > Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail > on polling error". > > Enabling -Wshadow would

Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-06 Thread Thomas Huth
On 06/10/2023 18.18, Thomas Huth wrote: On 06/10/2023 16.45, Markus Armbruster wrote: Local variables shadowing other local variables or parameters make the code needlessly hard to understand.  Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to

Re: [v3] Help wanted for enabling -Wshadow=local

2023-10-06 Thread Thomas Huth
On 06/10/2023 16.45, Markus Armbruster wrote: Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". Enabling -Wshadow

[v3] Help wanted for enabling -Wshadow=local

2023-10-06 Thread Markus Armbruster
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". Enabling -Wshadow would prevent bugs like this one. But we have to

Re: [v2] Help wanted for enabling -Wshadow=local

2023-09-26 Thread Markus Armbruster
Warner Losh writes: > On Tue, Sep 26, 2023 at 8:43 AM Markus Armbruster wrote: > >> Brian, Gerd, Jason, Marc-André, Michael, we need your help to enable >> -Wshadow=local. >> >> Paolo, you already took care of several subsystems (thanks!), except you >> left a few warnings in

Re: [v2] Help wanted for enabling -Wshadow=local

2023-09-26 Thread Warner Losh
On Tue, Sep 26, 2023 at 8:43 AM Markus Armbruster wrote: > Brian, Gerd, Jason, Marc-André, Michael, we need your help to enable > -Wshadow=local. > > Paolo, you already took care of several subsystems (thanks!), except you > left a few warnings in target/i386/tcg/seg_helper.c. > > > Local

Re: [v2] Help wanted for enabling -Wshadow=local

2023-09-26 Thread Paolo Bonzini
On 9/26/23 16:42, Markus Armbruster wrote: Overall Audio backends M: Gerd Hoffmann M: Marc-André Lureau audio/audio.c I can handle this too, but I first need to send out my next pull request. Paolo

Re: [v2] Help wanted for enabling -Wshadow=local

2023-09-26 Thread Markus Armbruster
Markus Armbruster writes: > Brian, Gerd, Jason, Marc-André, Michael, we need your help to enable > -Wshadow=local. > > Paolo, you already took care of several subsystems (thanks!), except you > left a few warnings in target/i386/tcg/seg_helper.c. Nope, I missed a patch; seg_helper.c is clean,

[v2] Help wanted for enabling -Wshadow=local

2023-09-26 Thread Markus Armbruster
Brian, Gerd, Jason, Marc-André, Michael, we need your help to enable -Wshadow=local. Paolo, you already took care of several subsystems (thanks!), except you left a few warnings in target/i386/tcg/seg_helper.c. Local variables shadowing other local variables or parameters make the code

Re: Help wanted for enabling -Wshadow=local

2023-09-25 Thread Warner Losh
On Sat, Sep 23, 2023 at 6:33 AM Peter Maydell wrote: > On Fri, 22 Sept 2023 at 19:59, Warner Losh wrote: > > The third one, though, makes me ask the question: When should we > > pass in cpu_env to functions and when should we use the global value? > > > > I have a lot of changes that look like:

Re: Help wanted for enabling -Wshadow=local

2023-09-23 Thread Peter Maydell
On Fri, 22 Sept 2023 at 19:59, Warner Losh wrote: > The third one, though, makes me ask the question: When should we > pass in cpu_env to functions and when should we use the global value? > > I have a lot of changes that look like: > > -static inline abi_long do_freebsd_thr_exit(CPUArchState

Re: Help wanted for enabling -Wshadow=local

2023-09-22 Thread Warner Losh
On Fri, Sep 22, 2023 at 11:49 AM Peter Maydell wrote: > On Fri, 22 Sept 2023 at 18:43, Daniel Henrique Barboza > wrote: > > Can you publish your branch with the current -Wshadow=local patches in > > gitlab/github? I'm hitting (and fixing) a lot of errors that aren't > listed > > here, meaning

Re: Help wanted for enabling -Wshadow=local

2023-09-22 Thread Peter Maydell
On Fri, 22 Sept 2023 at 18:43, Daniel Henrique Barboza wrote: > Can you publish your branch with the current -Wshadow=local patches in > gitlab/github? I'm hitting (and fixing) a lot of errors that aren't listed > here, meaning they're either fixed already in your local branch or needs to > be

Re: Help wanted for enabling -Wshadow=local

2023-09-22 Thread Ani Sinha
> On 22-Sep-2023, at 3:07 PM, Markus Armbruster wrote: > > X86 Machines > > PC > M: Michael S. Tsirkin > M: Marcel Apfelbaum >hw/i386/acpi-build.c(*3*) >hw/i386/acpi-microvm.c(*2*) >hw/i386/intel_iommu.c(*3*) >hw/i386/pc.c(*2*) >hw/i386/x86.c(*2*) Since I

Re: Help wanted for enabling -Wshadow=local

2023-09-22 Thread Peter Maydell
On Fri, 22 Sept 2023 at 10:37, Markus Armbruster wrote: > > If you are in To:, we need your help to enable -Wshadow=local. > > Local variables shadowing other local variables or parameters make the > code needlessly hard to understand. Bugs love to hide in such code. > Evidence: "[PATCH v3 1/7]

Re: Help wanted for enabling -Wshadow=local

2023-09-22 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Fri, Sep 22, 2023 at 04:03:27PM +0530, Ani Sinha wrote: >> >> >> > On 22-Sep-2023, at 3:07 PM, Markus Armbruster wrote: >> > >> > Devices >> > --- >> > ACPI/SMBIOS >> > M: Michael S. Tsirkin >> > M: Igor Mammedov >> > R: Ani Sinha >> >

Re: Help wanted for enabling -Wshadow=local

2023-09-22 Thread Michael S. Tsirkin
On Fri, Sep 22, 2023 at 04:03:27PM +0530, Ani Sinha wrote: > > > > On 22-Sep-2023, at 3:07 PM, Markus Armbruster wrote: > > > > Devices > > --- > > ACPI/SMBIOS > > M: Michael S. Tsirkin > > M: Igor Mammedov > > R: Ani Sinha > >hw/acpi/cpu_hotplug.c > >hw/i386/acpi-build.c(*3*) >

Re: Help wanted for enabling -Wshadow=local

2023-09-22 Thread Ani Sinha
> On 22-Sep-2023, at 3:07 PM, Markus Armbruster wrote: > > Devices > --- > ACPI/SMBIOS > M: Michael S. Tsirkin > M: Igor Mammedov > R: Ani Sinha >hw/acpi/cpu_hotplug.c >hw/i386/acpi-build.c(*3*) >hw/smbios/smbios.c I will look into this after enabling diff --git