aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2022-08-26 02:35:40 +1200
committerDavid Rowley <drowley@postgresql.org>2022-08-26 02:35:40 +1200
commit3e0fff2e6888e39b0ad5cdfdb78bc1c2bb2b22c9 (patch)
tree235e23ee1c87eb2f148216535c0d300bcbe0a64e /src/backend/commands
parente3ce2de09d814f8770b2e3b3c152b7671bcdb83f (diff)
downloadpostgresql-3e0fff2e6888e39b0ad5cdfdb78bc1c2bb2b22c9.tar.gz
postgresql-3e0fff2e6888e39b0ad5cdfdb78bc1c2bb2b22c9.zip
More -Wshadow=compatible-local warning fixes
In a similar effort to f01592f91, here we're targetting fixing the warnings where we've deemed the shadowing variable to serve a close enough purpose to the shadowed variable just to reuse the shadowed version and not declare the shadowing variable at all. By my count, this takes the warning count from 106 down to 71. Author: Justin Pryzby Discussion: https://postgr.es/m/20220825020839.GT2342@telsasoft.com
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/functioncmds.c3
-rw-r--r--src/backend/commands/tablecmds.c1
-rw-r--r--src/backend/commands/vacuum.c2
3 files changed, 0 insertions, 6 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index e7e37146f69..e6fcfc23b93 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -121,7 +121,6 @@ compute_return_type(TypeName *returnType, Oid languageOid,
{
char *typnam = TypeNameToString(returnType);
Oid namespaceId;
- AclResult aclresult;
char *typname;
ObjectAddress address;
@@ -1112,8 +1111,6 @@ CreateFunction(ParseState *pstate, CreateFunctionStmt *stmt)
if (languageStruct->lanpltrusted)
{
/* if trusted language, need USAGE privilege */
- AclResult aclresult;
-
aclresult = pg_language_aclcheck(languageOid, GetUserId(), ACL_USAGE);
if (aclresult != ACLCHECK_OK)
aclcheck_error(aclresult, OBJECT_LANGUAGE,
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 9be04c8a1e7..dacc989d855 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -16796,7 +16796,6 @@ PreCommit_on_commit_actions(void)
if (oids_to_drop != NIL)
{
ObjectAddresses *targetObjects = new_object_addresses();
- ListCell *l;
foreach(l, oids_to_drop)
{
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index dbdfe8bd2d4..3670d1f1861 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -233,8 +233,6 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel)
*/
if (!(params.options & VACOPT_ANALYZE))
{
- ListCell *lc;
-
foreach(lc, vacstmt->rels)
{
VacuumRelation *vrel = lfirst_node(VacuumRelation, lc);