From: Markus Armbruster <armbru@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel@nongnu.org, "Daniel P. Berrangé" <berrange@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Juan Quintela" <quintela@redhat.com>
Subject: Re: [RFC PATCH] docs/style: permit inline loop variables
Date: Thu, 31 Aug 2023 15:29:05 +0200 [thread overview]
Message-ID: <87y1hrpcgu.fsf@pond.sub.org> (raw)
In-Reply-To: <CAFEAcA8wobO5F16vYhbQCjeadfN5Zwx5CQ7L4vQ3fh8c_6ngJg@mail.gmail.com> (Peter Maydell's message of "Thu, 24 Aug 2023 14:18:53 +0100")
Peter Maydell <peter.maydell@linaro.org> writes:
> On Wed, 23 Aug 2023 at 06:59, Markus Armbruster <armbru@redhat.com> wrote:
>>
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>
>> > On Tue, 22 Aug 2023 at 16:50, Alex Bennée <alex.bennee@linaro.org> 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=shadow 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=local 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=local". Need help
to get the job finished.
next prev parent reply other threads:[~2023-08-31 13:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 15:50 [RFC PATCH] docs/style: permit inline loop variables Alex Bennée
2023-08-22 15:52 ` Stefan Hajnoczi
2023-08-22 15:57 ` Peter Maydell
2023-08-23 5:59 ` Markus Armbruster
2023-08-24 13:18 ` Peter Maydell
2023-08-31 13:29 ` Markus Armbruster [this message]
2023-08-22 16:09 ` Richard Henderson
2023-08-22 16:13 ` Thomas Huth
2023-08-22 16:31 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y1hrpcgu.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.