From: | Peter Smith <smithpb2250(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | pg_upgrade - a function parameter shadows global 'new_cluster' |
Date: | 2023-08-23 01:28:25 |
Message-ID: | CAHut+PvS_PHLntWy1yTgXv0O1tWm4iVcKBQFzpoQRDsm2Ce_Fg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi hackers.
During a recent review of nearby code I noticed that there was a shadowing
of the 'new_cluster' global variable by a function parameter:
Here:
static void check_for_new_tablespace_dir(ClusterInfo *new_cluster);
~~~
It looks like it has been like this for a couple of years. I guess this
might have been found/fixed earlier had the code been compiled differently:
check.c: In function ‘check_for_new_tablespace_dir’:
check.c:381:43: warning: declaration of ‘new_cluster’ shadows a global
declaration [-Wshadow]
check_for_new_tablespace_dir(ClusterInfo *new_cluster)
^
In file included from check.c:16:0:
pg_upgrade.h:337:4: warning: shadowed declaration is here [-Wshadow]
new_cluster;
^
~~~
PSA a small patch to remove the unnecessary parameter, and so eliminate
this shadowing.
Thoughts?
------
Kind Regards,
Peter Smith.
Fujitsu Australia.
Attachment | Content-Type | Size |
---|---|---|
v1-0001-Remove-the-shadowing-of-new_cluster-global.patch | application/octet-stream | 1.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Andy Fan | 2023-08-23 01:41:41 | Re: Support run-time partition pruning for hash join |
Previous Message | Andy Fan | 2023-08-23 01:19:34 | Re: Support run-time partition pruning for hash join |