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

Tom Lane <tgl@sss.pgh.pa.us>

Commit: cdaa67565867ba443afb66b9e82023d65487dc7c
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2026-03-02T19:40:29Z
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

Files

PathChange+/−
contrib/pg_trgm/trgm_regexp.c modified +5 −9

Discussion