From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56282CD4846 for ; Fri, 22 Sep 2023 17:44:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjkBs-000539-UY; Fri, 22 Sep 2023 13:43:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjkBr-00052o-NA for qemu-devel@nongnu.org; Fri, 22 Sep 2023 13:43:43 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qjkBp-0001JU-PG for qemu-devel@nongnu.org; Fri, 22 Sep 2023 13:43:43 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1c434c33ec0so20955205ad.3 for ; Fri, 22 Sep 2023 10:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695404620; x=1696009420; darn=nongnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=a2yOU2tFkJGeyQQijMlrCR1AC3BfTRpV8XjGZ7FUE1w=; b=M7EKW5Okv/PieilBOqHw6yUV8xqMtNpkgoub6t4p+uljWICrGGBQQgecNK8YmLJN8D Fql2kVncOFUvoSZ/Vj3vEcp1j1dP32GvIOhmOg1UqMp47oWG7ilYDgAypME6bQVkNkUE pQeaqRxgQmaZlj/YyxMX7KHu/UoTJe0A2So1AGfPIyt0BEBNN+UEweRM9LAgKcf9WMQM jeH9agzF8wLELpJloeCiPtJ2wyHxBO1Ngrpt0nA+booWXSQPdiglBeUgkzd8g+1vLEvN 48uA9MBOfvjjLlEIZwB9OW1hREIjTP1M1hIjKjJkZKkHZZb7UW1TVfc9Nb6qx1QFW44o P3mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695404620; x=1696009420; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a2yOU2tFkJGeyQQijMlrCR1AC3BfTRpV8XjGZ7FUE1w=; b=PUKQqZC99/fUYMPqaaZxZzrE7g02sCwWkWR4gNwKlh2ngi47ROBZEIFK6PVi7/V6oH yoMByCFrHMekCOg8KoPtLA66Jyx6Ee3HPY9MrTdY/fno/+Q78yJGJj10gVY+4I0GQ6Vv XiCwMIDVWQnLNoIRr3ReTtpZbpk+xm9P/7MYuzSbjelGfnvFH2JBh0tGDVM+YixKb5JE oCe77q6r5UEyoXTVWPKALEZ4vJ42Fdf2nHcw8/MKShAiMR5a/C/Lxs4dAACwFO3weAOv /IocsbQlh+N8vqi/Q3xum5Kb187RL/VE7wrY9Ds4ETNsL+hpF6rjKyYKwb5/L6k39LFr ujNA== X-Gm-Message-State: AOJu0Yy6W17AVpCrlZsSu5IbIf2wD8n2BQCwisMuhyRsniKmiW48qqAR 3nmNpUghRgdauHblv5aGnt8= X-Google-Smtp-Source: AGHT+IFaS8MzcwraPr5A5GEiWovwt7petQgtY957Q51KN3oAYYyJEz4Vjn2ZJ7qQxyIu2FWyCVFOdA== X-Received: by 2002:a17:903:244e:b0:1c5:a09e:170a with SMTP id l14-20020a170903244e00b001c5a09e170amr217113pls.54.1695404620105; Fri, 22 Sep 2023 10:43:40 -0700 (PDT) Received: from [192.168.68.107] ([177.94.42.59]) by smtp.gmail.com with ESMTPSA id jk23-20020a170903331700b001bb04755212sm3767825plb.228.2023.09.22.10.43.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Sep 2023 10:43:39 -0700 (PDT) Message-ID: Date: Fri, 22 Sep 2023 14:43:30 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: Help wanted for enabling -Wshadow=local Content-Language: en-US To: Markus Armbruster , qemu-devel@nongnu.org, Alberto Garcia , Alistair Francis , Andrew Jeffery , Ani Sinha , Brian Cain , =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , "Daniel P. Berrange" , David Gibson , Eduardo Habkost , Eric Auger , Eric Blake , Fam Zheng , Fan Ni , Gerd Hoffmann , Igor Mammedov , Jason Wang , Joel Stanley , Jonathan Cameron , Keith Busch , Klaus Jensen , Laurent Vivier , Laurent Vivier , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Marcel Apfelbaum , Marcelo Tosatti , "Michael S. Tsirkin" , Nicholas Piggin , Paolo Bonzini , Peter Maydell , Peter Xu , Richard Henderson , Song Gao , Thomas Huth , Vladimir Sementsov-Ogievskiy , Xiaojuan Yang Cc: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= References: <87r0mqlf9x.fsf@pond.sub.org> From: Daniel Henrique Barboza In-Reply-To: <87r0mqlf9x.fsf@pond.sub.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=danielhb413@gmail.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, NICE_REPLY_A=-1.473, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Markus, 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 fixed. Thanks, Daniel On 9/22/23 06: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] migration/rdma: Fix save_page method to fail > on polling error". > > Enabling -Wshadow would prevent bugs like this one. But we have to > clean up all the offenders first. > > I collected the patches posted so far: > > [PATCH v3 0/7] Steps towards enabling -Wshadow=local > Message-ID: <20230921121312.1301864-1-armbru@redhat.com> > > [PATCH v2 00/22] (few more) Steps towards enabling -Wshadow > Message-ID: <20230904161235.84651-1-philmd@linaro.org> > > [PATCH 0/3] (few more) Steps towards enabling -Wshadow [3 more] > Message-ID: <20230904162824.85385-1-philmd@linaro.org> > > [PATCH 0/8] ppc: Clean up local variable shadowing > Message-ID: <20230918145850.241074-1-clg@kaod.org> > > Thanks, Philippe & Cedric! > > In my local build with -Wshadow=local, warnings remain in just 56 files. > > Sorted by subsystems, files covered by multiple subsystems marked > "(*NUMBER*)", files not covered in MAINTAINERS marked (*guess*): > > Guest CPU cores (TCG) > --------------------- > ARM TCG CPUs > M: Peter Maydell > hw/arm/smmuv3-internal.h(*2*) > hw/arm/smmuv3.c(*2*) > > ARM SMMU > M: Eric Auger > hw/arm/smmuv3-internal.h(*2*) > hw/arm/smmuv3.c(*2*) > > Hexagon TCG CPUs > M: Brian Cain > target/hexagon/gen_helper_funcs.py > target/hexagon/mmvec/macros.h > target/hexagon/op_helper.c > target/hexagon/translate.c > > M68K TCG CPUs > M: Laurent Vivier > disas/m68k.c > > PowerPC TCG CPUs > M: Nicholas Piggin > M: Daniel Henrique Barboza > R: Cédric Le Goater > target/ppc/int_helper.c > > RISC-V TCG CPUs > hw/riscv/opentitan.c(*2*) > target/riscv/cpu.c > target/riscv/vector_helper.c > > X86 TCG CPUs > M: Paolo Bonzini > M: Richard Henderson > M: Eduardo Habkost > 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*) > target/i386/cpu.c(*guess*) > target/i386/tcg/seg_helper.c > target/i386/tcg/sysemu/svm_helper.c > target/i386/tcg/translate.c > > Guest CPU Cores (KVM) > --------------------- > X86 KVM CPUs > M: Paolo Bonzini > M: Marcelo Tosatti > target/i386/kvm/kvm.c > > ARM Machines > ------------ > ARM cores > M: Peter Maydell > hw/intc/arm_gicv3_its.c > > Versatile PB > M: Peter Maydell > hw/misc/arm_sysctl.c > > ASPEED BMCs > M: Cédric Le Goater > M: Peter Maydell > R: Andrew Jeffery > R: Joel Stanley > hw/i2c/aspeed_i2c.c > hw/misc/aspeed_i3c.c > > LoongArch Machines > ------------------ > Virt > M: Xiaojuan Yang > M: Song Gao > hw/loongarch/virt.c > > RISC-V Machines > --------------- > OpenTitan > M: Alistair Francis > hw/riscv/opentitan.c(*2*) > > 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*) > > PC Chipset > M: Michael S. Tsirkin > M: Paolo Bonzini > hw/i2c/pm_smbus.c > > 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 > > Network devices > M: Jason Wang > hw/net/vhost_net.c(*2*) > > SCSI > M: Paolo Bonzini > R: Fam Zheng > hw/scsi/mptsas.c > > USB > M: Gerd Hoffmann > hw/usb/desc.c > hw/usb/dev-hub.c > hw/usb/dev-storage.c > hw/usb/hcd-xhci.c > hw/usb/host-libusb.c > > vhost > M: Michael S. Tsirkin > contrib/vhost-user-gpu/vhost-user-gpu.c(*2*) > contrib/vhost-user-gpu/vugpu.h(*2*) > hw/net/vhost_net.c(*2*) > hw/virtio/vhost.c > > virtio > M: Michael S. Tsirkin > hw/virtio/virtio-pci.c > include/hw/virtio/virtio-gpu.h(*2*) > > nvme > M: Keith Busch > M: Klaus Jensen > hw/nvme/ns.c > > virtio-gpu > M: Gerd Hoffmann > include/hw/virtio/virtio-gpu.h(*2*) > > vhost-user-gpu > M: Marc-André Lureau > R: Gerd Hoffmann > contrib/vhost-user-gpu/vhost-user-gpu.c(*2*) > contrib/vhost-user-gpu/vugpu.h(*2*) > > Subsystems > ---------- > Overall Audio backends > M: Gerd Hoffmann > M: Marc-André Lureau > audio/audio.c > > Open Sound System (OSS) Audio backend > M: Gerd Hoffmann > audio/ossaudio.c > > Compute Express Link > M: Jonathan Cameron > R: Fan Ni > include/hw/cxl/cxl_device.h > > Device Tree > M: Alistair Francis > R: David Gibson > softmmu/device_tree.c > > Dump > M: Marc-André Lureau > dump/dump.c > > Main loop > M: Paolo Bonzini > softmmu/vl.c > > qtest > M: Thomas Huth > M: Laurent Vivier > R: Paolo Bonzini > tests/qtest/m48t59-test.c > > Seccomp > M: Daniel P. Berrange > softmmu/qemu-seccomp.c > > Cryptography > M: Daniel P. Berrange > crypto/tls-cipher-suites.c > > Throttling infrastructure > M: Alberto Garcia > tests/unit/test-throttle.c > > VT-d Emulation > M: Michael S. Tsirkin > M: Peter Xu > R: Jason Wang > hw/i386/intel_iommu.c(*3*) > > Usermode Emulation > ------------------ > Linux user > M: Laurent Vivier > linux-user/flatload.c > linux-user/mmap.c > linux-user/syscall.c > > Block drivers > ------------- > Network Block Device (NBD) > M: Eric Blake > M: Vladimir Sementsov-Ogievskiy > qemu-nbd.c >