meson: Enable -Wshadow=localpull-shadow-2023-11-13
commit569205e4e92f802cf409fe03dd2ac41dd0b54aae
authorMarkus Armbruster <armbru@redhat.com>
Thu, 26 Oct 2023 05:31:15 +0000 (26 07:31 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 13 Nov 2023 09:32:57 +0000 (13 10:32 +0100)
tree5a0834a1b167f9cddf085478de54375d53b9c6db
parent6ab4f1c9e2def22f766ed36d903484b67a2fd95b
meson: 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: commit bbde656263d (migration/rdma: Fix save_page method to
fail on polling error).

Enable -Wshadow=local to prevent such issues.  Possible thanks to
recent cleanups.  Enabling -Wshadow would prevent more issues, but
we're not yet ready for that.

As usual, the warning is only enabled when the compiler recognizes it.
GCC does, Clang doesn't.

Some shadowed locals remain in bsd-user.  Since BSD prefers Clang,
let's not wait for its cleanup.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20231026053115.2066744-2-armbru@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
meson.build