Proposal: adding --enable-shadows-warning

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Proposal: adding --enable-shadows-warning
Date: 2025-11-28 09:02:09
Message-ID: 265AA84A-1CBD-44E3-9F21-D08360DBD768@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

I had an experience where I made a patch ready locally, build passed without any warning, however, CommitFest CI failed with a compile waring of shadows variable. I felt strange at the time but now I understand that is because some compilers, like clang I am using, don’t enable -Wshadow by default. So obviously the CommitFest CI has enabled -Wshadow. Such a situation is kinda wasting patch author’s time.

To make hacker’s life easier, it would make sense to always enable “-Wshadow”, however, that may have a risk of breaking some compilers. So thinking over, I just fell adding an opt-in “—enable-shadows-warnings” could be a solution.

Before the option is added “./confgure”, a workaround is like: PROFILE=“-Wshadow” make, but that way is just a workaround, it’s easy to forget use the extra thing together with make.

I have tried to add the option locally, but end up I gave up because of the issue I posted in a separate thread [1]. Once [1] is resolved and if no objection on this proposal, then I will be happy to create a patch to add this option.

[1] https://postgr.es/m/913843DF-16BA-4241-8191-BF892049744A@gmail.com

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jakub Wartak 2025-11-28 09:02:50 Re: Migrate to autoconf 2.72?
Previous Message shveta malik 2025-11-28 09:01:59 Re: Proposal: Conflict log history table for Logical Replication