Re: Fix -Wshadow=local warnings

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix -Wshadow=local warnings
Date: 2026-09-01 15:24:06
Message-ID: CAH2-WzktYdMMGh+JKyXYptvd0gH1RZzpYATTrJNxDdEhc+84PA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 1, 2026 at 10:59 AM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
> These can be caught if we dial up the warning one notch to
> -Wshadow=local. This then flags all shadowing of a local variable by
> another local variable. I have fixed all the warnings in the attached
> patch. I think everything this catches is obviously bad, so this seems
> well worth fixing. (And if we buy into the idea of
> -Wshadow=compatible-local, then this is obviously better and more complete.)

+1 to fixing all of these, and to using -Wshadow=compatible-local.

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2026-09-01 15:31:55 Re: [PATCH] Remove dead code in pg_dump
Previous Message Japin Li 2026-09-01 15:21:13 Re: Reduce build times of pg_trgm GIN indexes