Re: Proposal: adding --enable-shadows-warning - Mailing list pgsql-hackers

From Chao Li
Subject Re: Proposal: adding --enable-shadows-warning
Date
Msg-id DD9CFD73-F5B6-4225-A506-B27185CE5BC0@gmail.com
Whole thread Raw
In response to Re: Proposal: adding --enable-shadows-warning  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Proposal: adding --enable-shadows-warning
List pgsql-hackers

> On Nov 28, 2025, at 17:20, Daniel Gustafsson <daniel@yesql.se> wrote:
>
>> On 28 Nov 2025, at 10:02, Chao Li <li.evan.chao@gmail.com> wrote:
>
>> To make hacker’s life easier, it would make sense to always enable “-Wshadow”, however, that may have a risk of
breakingsome compilers. So thinking over, I just fell adding an opt-in “—enable-shadows-warnings” could be a solution. 
>
> I'm not sure that adding buildsystem flags for compiler behaviour is the right
> direction, isn't the environment variables like CFLAGS already covering this?
>

Like I explained in my first email, using PROFILE can append extra options to CFLAGS, I am always use this method to
append‘-O0’ to CFLAGS. However, this way is easy to missing the extra option to add. As CommitFest CI always enable
-Wshadows,we should allow developers to always enable the option in local. 

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Fix a recent "shadow warning" in subscriptioncmds.c
Next
From: Matthias van de Meent
Date:
Subject: Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements