From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add -Wshadow=compatible-local to the standard compilation flags
Date: Fri, 07 Oct 2022 03:50:52 +0000
Message-ID: <E1ogeNv-001FkD-Ug@gemulon.postgresql.org> (raw)
Add -Wshadow=compatible-local to the standard compilation flags
Since cd4e8caaa, we've been able to build the source tree with
-Wshadow=compatible-local without any warnings. Lots of work was done by
Justin Pryzby and I (David) to get all our code to compile warning free
with that flag. In that process, 2 bugs (16d69ec29 and af7d270dd) were
discovered and fixed. Additionally, "git log --grep=shadow" shows that
there is no shortage of other bugs that have been fixed over the years
which were caused by variable shadowing.
In light of the above, it seems very much worthwhile to add at least
-Wshadow=compatible-local to our standard compilation flags. We *may*
want to go further and take this to -Wshadow=local in the future, but
we're not ready for that today, so let's add -Wshadow=compatible-local now
to help make sure we don't introduce further local variable shadowing.
Author: Andres Freund
Discussion: https://postgr.es/m/20221006003920.6xlqaoccxwisza5k@awork3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/0fe954c28584169938e5c0738cfaa9930ce77577
Modified Files
--------------
configure | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 2 ++
meson.build | 1 +
3 files changed, 94 insertions(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: drowley@postgresql.org
Subject: Re: pgsql: Add -Wshadow=compatible-local to the standard compilation flags
In-Reply-To: <E1ogeNv-001FkD-Ug@gemulon.postgresql.org>
References: <E1ogeNv-001FkD-Ug@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox