Re: Cleanup shadows variable warnings, round 1 - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Cleanup shadows variable warnings, round 1
Date
Msg-id aTDcJ_BokHcQXRcW@paquier.xyz
Whole thread Raw
In response to Re: Cleanup shadows variable warnings, round 1  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
On Fri, Nov 28, 2025 at 11:11:04AM +0200, Heikki Linnakangas wrote:
> I don't know if we've agreed on a goal of getting rid of all shadowing, it's
> a lot of code churn. I agree shadowing is often confusing and error-prone,
> so maybe it's worth it.

(Providing my own context with more information on the matter, Peter
E. mentioning this commit upthread.)

As far as I know, the latest consensus with shadow variables was that
-Wshadow=compatible-local was OK for now, 0fe954c28584 mentioning that
we could consider a tighter -Wshadow=local later on.  I don't recall a
clear objection about doing a tighter move, just that it was a lot of
work for unclear gains especially when it comes to the extra
backpatching noise.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: WangYu
Date:
Subject: Re:Re: Extended Statistics set/restore/clear functions.
Next
From: Peter Smith
Date:
Subject: Re: Cleanup shadows variable warnings, round 1