Re: Fix -Wshadow=local warnings

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix -Wshadow=local warnings
Date: 2026-09-25 05:30:39
Message-ID: 566b149d-a7a1-46ce-9944-b2cf84cbf066@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17.09.26 11:29, Peter Eisentraut wrote:
> On 02.09.26 07:19, Chao Li wrote:
>> A few small comments:
>>
>> 1 - 0001 - dependencies.c
>> ```
>>    * expression into *expr.
>>    */
>>   static bool
>> -dependency_is_compatible_expression(Node *clause, Index relid, List
>> *statlist, Node **expr)
>> +dependency_is_compatible_expression(Node *clause, Index relid, List
>> *statlist, Node **stat_expr_p)
>> ```
>>
>> As “expr” is renamed, the function header comment needs to be updated
>> as well.
>>
>> 2 - 0001 - pg_constraint.c
>> ```
>> +            CookedConstraint *cooked_constr;
>> ```
>>
>> In the current RelationGetNotNullConstraints(), other local variables
>> use camelCase naming, for example constrRel, so maybe it would be
>> better to keep the naming style consistent.
>
> Thanks, the patch with the code changes has been committed, with your
> suggestions incorporated.
>
> The patch to activate the option couldn't be committed yet because the
> workaround for the LLVM headers didn't work and had to be reverted
> (commit 7a0aa99e51c).  I have worked on a new solution that works more
> along the lines of how other per-file or per-module "-Wno-..." options
> are handled.  I think this will be simpler and less fragile.  See
> attached patch.

This has been committed, and the buildfarm seems to be quiet about it so
far.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message kedar anavardekar 2026-09-25 05:40:29 Re: Proposal: Conflict log history table for Logical Replication
Previous Message shihao zhong 2026-09-25 05:07:25 Re: [PATCH] Refactor remaining zero-fill relation extensions to use smgrzeroextend()