Peter Maydell <peter.mayd...@linaro.org> writes: > On Tue, 22 Aug 2023 at 16:50, Alex Bennée <alex.ben...@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. > Anyway, I think declaration-in-for-loop is OK and we > already have quite a lot of instances of it. Acked-by: Markus Armbruster <arm...@redhat.com>