Re: Cleanup shadows variable warnings, round 1

Álvaro Herrera <alvherre@kurilemu.de>

From: Álvaro Herrera <alvherre@kurilemu.de>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Chao Li <li.evan.chao@gmail.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>, Peter Eisentraut <peter@eisentraut.org>, Peter Smith <smithpb2250@gmail.com>
Date: 2026-04-21T13:51:10Z
Lists: pgsql-hackers
On 2026-Apr-21, David Rowley wrote:

> On Tue, 21 Apr 2026 at 19:02, Chao Li <li.evan.chao@gmail.com> wrote:
> > PFA v8 - rebased and fixed a few new occurrences.
> 
> Which of these are new to v19?  Can you separate those ones out? IMO,
> we should commit at least those, as those won't cause any backpatching
> pain.

I agree.  The others are v20 material.


Specifically about 0003 (v20 material for sure, as this is ancient
code), I don't like this patch very much.  I wonder if it would be
possible to do away with the idea of using these codeFragment things
without introducing a performance issue here.  Is that doable by turning
these macros into static functions?

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Puedes vivir sólo una vez, pero si lo haces bien, una vez es suficiente"



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix new-to-v19 -Wshadow warnings

  2. Reduce scope of for-loop-local variables to avoid shadowing

  3. Fix local-variable shadowing in pg_trgm's printSourceNFA().