public inbox for [email protected]  
help / color / mirror / Atom feed
From: David Rowley <[email protected]>
To: Tom Lane <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Remove shadowed declaration warnings
Date: Thu, 12 Sep 2024 14:25:38 +1200
Message-ID: <CAApHDvqaa3YXqTF2cZ0ocwXvvpqEwAPHpBAO_0Sfwa6ORhYYHQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAHut+Pve+Dyq_piJPG0Ykhn7-gnBsXqge2HQt-baB4i9TJAfnA@mail.gmail.com>
	<CAApHDvpkr2TdZss4amJGXh0cxVzU+DHpphnmgE89Qazb58Vc6w@mail.gmail.com>
	<[email protected]>

On Thu, 12 Sept 2024 at 14:03, Tom Lane <[email protected]> wrote:
> I do grant that sometimes shadowing of locals can cause bugs.  I don't
> recall right now why we opted for -Wshadow=compatible-local over
> -Wshadow=local, but we could certainly take another look at that.

I don't recall if it was discussed, but certainly, it was an easier
goal to achieve.

Looks like there are currently 47 warnings with -Wshadow=local. I'm
not quite sure what the definition of "compatible" is for this flag,
but looking at one warning in pgbench.c:4548, I see an int shadowing a
bool. So maybe -Wshadow=local is worthwhile.

David






view thread (6+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Remove shadowed declaration warnings
  In-Reply-To: <CAApHDvqaa3YXqTF2cZ0ocwXvvpqEwAPHpBAO_0Sfwa6ORhYYHQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox