Re: shadow variables - pg15 edition - Mailing list pgsql-hackers

From David Rowley
Subject Re: shadow variables - pg15 edition
Date
Msg-id CAApHDvr2fh-ann9zSOYKKR0wbDAq337=wo_A=1b6ebOkQuzR=Q@mail.gmail.com
Whole thread Raw
In response to Re: shadow variables - pg15 edition  (Michael Paquier <michael@paquier.xyz>)
Responses Re: shadow variables - pg15 edition  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Wed, 12 Oct 2022 at 14:39, Michael Paquier <michael@paquier.xyz> wrote:
> -Wshadow=compatible-local causes one extra warning in postgres.c with
> -DWRITE_READ_PARSE_PLAN_TREES:
> postgres.c: In function ‘pg_rewrite_query’:
> postgres.c:818:37: warning: declaration of ‘query’ shadows a parameter [-Wshadow=compatible-local]
>   818 |                         Query      *query = lfirst_node(Query, lc);
>       |                                     ^~~~~
> postgres.c:771:25: note: shadowed declaration is here
>   771 | pg_rewrite_query(Query *query)
>       |                  ~~~~~~~^~~~~
>
> Something like the patch attached would deal with this one.

Thanks for finding that and coming up with the patch. It looks fine to
me. Do you want to push it?

David



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: shadow variables - pg15 edition
Next
From: Michael Paquier
Date:
Subject: Re: Issue in GIN fast-insert: XLogBeginInsert + Read/LockBuffer ordering