Re: [Proposal] Level4 Warnings show many shadow vars

From: Mark Dilger <hornschnorter(at)gmail(dot)com>
To: Ranier Vilela <ranier_gyn(at)hotmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Proposal] Level4 Warnings show many shadow vars
Date: 2019-12-05 21:06:38
Message-ID: 1afd29e8-bdd4-e848-b763-9a00ce74b8ef@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/3/19 5:24 PM, Ranier Vilela wrote:
> Hi,
> 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?

I suggested increasing the default warnings in an email some time ago,
to which Tom made reasonable objections. You might want to take a
look at his comments, and consider if you can overcome the concerns
he had:

https://www.postgresql.org/message-id/25938.1487367117%40sss.pgh.pa.us

and

https://www.postgresql.org/message-id/30007.1487374499%40sss.pgh.pa.us

--
Mark Dilger

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Adriaanse 2019-12-05 21:14:12 Corruption with duplicate primary key
Previous Message Thomas Munro 2019-12-05 21:03:44 Re: Append with naive multiplexing of FDWs