Re: Remove shadowed declaration warnings - Mailing list pgsql-hackers

From David Rowley
Subject Re: Remove shadowed declaration warnings
Date
Msg-id CAApHDvqaa3YXqTF2cZ0ocwXvvpqEwAPHpBAO_0Sfwa6ORhYYHQ@mail.gmail.com
Whole thread Raw
In response to Re: Remove shadowed declaration warnings  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Remove shadowed declaration warnings
List pgsql-hackers
On Thu, 12 Sept 2024 at 14:03, Tom Lane <tgl@sss.pgh.pa.us> 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



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: json_query conditional wrapper bug
Next
From: David Rowley
Date:
Subject: Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN