pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix local-variable shadowing in pg_trgm's printSourceNFA().
Date: Mon, 02 Mar 2026 19:40:59 +0000
Message-ID: <E1vx98V-0022r9-0W@gemulon.postgresql.org> (raw)

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

We hadn't noticed this violation of -Wshadow=compatible-local
because this function isn't compiled without -DTRGM_REGEXP_DEBUG.

As long as we have to clean it up, let's do so by converting all
this function's loops to use C99 loop-local control variables.

Reported-by: Sergei Kornilov <sk@zsrv.org>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/3009911772478436@08341ecb-668d-43a9-af4d-b45f00c72521

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cdaa67565867ba443afb66b9e82023d65487dc7c

Modified Files
--------------
contrib/pg_trgm/trgm_regexp.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)



Message-ID: <E1vx98V-0022r9-0W@gemulon.postgresql.org>
Permalink:  ../E1vx98V-0022r9-0W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vx98V-0022r9-0W@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix local-variable shadowing in pg_trgm's printSourceNFA().
  In-Reply-To: <E1vx98V-0022r9-0W@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox