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 67000C83F01 for ; Thu, 31 Aug 2023 13:29:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbhjW-0004e8-LZ; Thu, 31 Aug 2023 09:29:14 -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 1qbhjV-0004as-0M for qemu-devel@nongnu.org; Thu, 31 Aug 2023 09:29:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbhjS-0007wh-Tz for qemu-devel@nongnu.org; Thu, 31 Aug 2023 09:29:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693488550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hpVj9zfUDroV17DsshIz9PjIneIPPBDk0SU3hn/JrPk=; b=e4HCLwwdP1osW3BM2MEblgr/DQoFfCJnMGJTYZqytUk1eXFasxwQNihdsBLAYErzWo4W4U dwZtpkZQr3Dtb9btEAGJidcbDoiYcRPIRV6apZ9LjbvBQWPaPbfujUInAWK9R6zIvW2Gq7 VA03xyraCoh2UTcC7GVXMXwm1y4qdQw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-393-ffoM4LkQM8yBuT_ZC147qw-1; Thu, 31 Aug 2023 09:29:06 -0400 X-MC-Unique: ffoM4LkQM8yBuT_ZC147qw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 724CC85CCE3; Thu, 31 Aug 2023 13:29:06 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 515052026D35; Thu, 31 Aug 2023 13:29:06 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6499721E690D; Thu, 31 Aug 2023 15:29:05 +0200 (CEST) From: Markus Armbruster To: Peter Maydell Cc: Alex =?utf-8?Q?Benn=C3=A9e?= , qemu-devel@nongnu.org, Daniel P. =?utf-8?Q?Berrang=C3=A9?= , Thomas Huth , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Juan Quintela Subject: Re: [RFC PATCH] docs/style: permit inline loop variables References: <20230822155004.1158931-1-alex.bennee@linaro.org> <87jztmz4bu.fsf@pond.sub.org> Date: Thu, 31 Aug 2023 15:29:05 +0200 In-Reply-To: (Peter Maydell's message of "Thu, 24 Aug 2023 14:18:53 +0100") Message-ID: <87y1hrpcgu.fsf@pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 Peter Maydell writes: > On Wed, 23 Aug 2023 at 06:59, Markus Armbruster wrote: >> >> Peter Maydell writes: >> >> > On Tue, 22 Aug 2023 at 16:50, Alex Benn=C3=A9e wrote: >> >> I've already wasted enough of my time debugging aliased variables in >> >> deeply nested loops. >> > >> > In theory we could try to enable -Wshadow and deal with >> > all the existing cases of aliasing, which would then >> > allow us to turn it into an error and catch your bugs :-) >> >> In practice, a quick compile with -Wshadow -Wno-error=3Dshadow coughs up >> almost 6000 warnings. There are duplicates since we compile many files >> multiple times, so I piped through sort -u | wc -l, and got about 1200. > > -Wshadow=3Dlocal has only 211 non-duplicate warnings, which > is almost tractable... > > (A lot of the duplicates are from local variables declared in macros > like MAX(), MIN() and QOBJECT(), when those macros are used in a nested > way, like MIN(MIN(x,y),z). We could deal with those by using the > __COUNTER__ trick, I guess.) Oooh, preprocessor trickery! I posted "[PATCH 0/7] Steps towards enabling -Wshadow=3Dlocal". Need help to get the job finished.