Re: [Proposal] Level4 Warnings show many shadow vars

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ranier Vilela <ranier_gyn(at)hotmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Proposal] Level4 Warnings show many shadow vars
Date: 2019-12-09 14:33:15
Message-ID: CA+Tgmoach3yBO=owjcF_O4G=V9ixeV8HcKsciijGaq5zpF3y2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Dec 8, 2019 at 1:52 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Ranier Vilela <ranier_gyn(at)hotmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-12-09 14:35:30 Re: ERROR: uncommitted xmin 347341220 from before xid cutoff 967029200 needs to be frozen
Previous Message Daniel Gustafsson 2019-12-09 12:02:14 Re: [Proposal] Level4 Warnings show many shadow vars