Re: [Proposal] Level4 Warnings show many shadow vars
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Ranier Vilela <ranier_gyn@hotmail.com>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2019-12-05T15:28:35Z
Lists: pgsql-hackers
On Tue, Dec 3, 2019 at 8:24 PM Ranier Vilela <ranier_gyn@hotmail.com> wrote: > I believe PostgreSQL can benefit from changing the alert level of compilation warnings. > The current Level3 level for windows does not show any alerts, but that does not mean that there are no problems. > Changing the level to Level4 and its equivalent for GCC in Unix environments will show many warnings for shadow variables, including global variables. > True, there will also be many silly alerts that can be safely disabled. > Shadow variables, although they may not currently represent bugs, may be hiding errors, or at the very least, it is a waste of variable declaration. > With the current Level3 level, development is no longer checking and correcting shadow variables. > > Any comments? Most of us don't develop on Windows, so changing warning levels on Windows won't really affect what developers see on their own machines, and thus probably doesn't have much value. It might be a good idea to try to clean up some/many cases of shadowed variables, though. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Remove shadow variables linked to RedoRecPtr in xlog.c
- 668365014d7b 11.7 landed
- 35c01529b8c9 12.2 landed
- 70116493a8e0 13.0 landed
-
Fix calculation for WAL segment recycling and removal
- d9fadbf13103 12.0 cited