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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix local-variable shadowing in pg_trgm's printSourceNFA().
Date: 2026-03-02 19:40:59
Message-ID: E1vx98V-0022r9-0W@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)zsrv(dot)org>
Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2026-03-03 04:15:44 pgsql: style: define parameterless functions as foo(void).
Previous Message Nathan Bossart 2026-03-02 19:23:45 pgsql: Add commit 7b24959434 to .git-blame-ignore-revs.