Re: [Proposal] Level4 Warnings show many shadow vars - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [Proposal] Level4 Warnings show many shadow vars
Date
Msg-id CA+Tgmoach3yBO=owjcF_O4G=V9ixeV8HcKsciijGaq5zpF3y2Q@mail.gmail.com
Whole thread Raw
In response to Re: [Proposal] Level4 Warnings show many shadow vars  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [Proposal] Level4 Warnings show many shadow vars  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Dec 8, 2019 at 1:52 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Ranier Vilela <ranier_gyn@hotmail.com> writes:
> > This is the first part of the variable shadow fixes.
> > Basically it consists of renaming the variables in collision with the global ones, with the minimum change in the
semantics.
>
> I don't think I'm actually on board with the goal here.

I don't know what to do about the RedoRecPtr mess, but surely
subscriptioncmds.c's use of synchronous_commit as a char * when it's
already exists as a global variable of type int is not good practice.
We've been known to do things like reference globals from within macro
definitions, and while static inlining is likely to make that practice
less common in the future, we've got plenty of existing instances,
including one that uses that exact variable name (SyncRepRequested()).

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: [Proposal] Level4 Warnings show many shadow vars
Next
From: Robert Haas
Date:
Subject: Re: ERROR: uncommitted xmin 347341220 from before xid cutoff967029200 needs to be frozen