pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove shadowed local variables that are new in v15
Date: Fri, 19 Aug 2022 23:42:04 +0000
Message-ID: <E1oPBcp-000KKL-28@gemulon.postgresql.org> (raw)

Remove shadowed local variables that are new in v15

Compiling with -Wshadow=compatible-local yields quite a few warnings about
local variables being shadowed by compatible local variables in an inner
scope.  Of course, this is perfectly valid in C, but we have had bugs in
the past as a result of developers failing to notice this.  af7d270dd is a
recent example.

Here we do a cleanup of warnings we receive from -Wshadow=compatible-local
for code which is new to PostgreSQL 15.  We've yet to have the discussion
about if we actually ever want to run that as a standard compilation flag.
We'll need to at least get the number of warnings down to something easier
to manage before we can realistically consider if we want this or not.
This commit is the first step towards reducing the warnings.

The changes being made here are all fairly trivial.  Because of that, and
the fact that v15 is still in beta, this is being back-patched into 15.
It seems more risky not to do this as the risk of future bugs is increased
by the additional conflicts that this commit could cause for any future
bug fixes touching the same areas as this commit.

Author: Justin Pryzby
Discussion: https://postgr.es/m/20220817145434.GC26426%40telsasoft.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/24f457aa2b7006e4b427a3ac1e7ce0f248b55ba3

Modified Files
--------------
src/backend/backup/basebackup_target.c      | 12 ++++-----
src/backend/parser/parse_jsontable.c        |  6 ++---
src/backend/replication/logical/tablesync.c | 23 ++++++-----------
src/backend/utils/adt/jsonpath_exec.c       |  6 ++---
src/bin/pg_dump/pg_dump.c                   | 38 ++++++++++++++---------------
5 files changed, 39 insertions(+), 46 deletions(-)



view thread (2+ messages)

Message-ID: <E1oPBcp-000KKL-28@gemulon.postgresql.org>
Permalink:  ../E1oPBcp-000KKL-28@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oPBcp-000KKL-28@gemulon.postgresql.org

 · 

reply

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: Remove shadowed local variables that are new in v15
  In-Reply-To: <E1oPBcp-000KKL-28@gemulon.postgresql.org>
  References: <E1oPBcp-000KKL-28@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