aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonpath_exec.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2022-08-20 11:40:59 +1200
committerDavid Rowley <drowley@postgresql.org>2022-08-20 11:40:59 +1200
commit24f457aa2b7006e4b427a3ac1e7ce0f248b55ba3 (patch)
tree68dd9358d6c72a2cd3e5270b51a4418ef9826bdc /src/backend/utils/adt/jsonpath_exec.c
parent4496020e6dfaffe8217e4d3f85567bb2b6927b45 (diff)
downloadpostgresql-24f457aa2b7006e4b427a3ac1e7ce0f248b55ba3.tar.gz
postgresql-24f457aa2b7006e4b427a3ac1e7ce0f248b55ba3.zip
Remove shadowed local variables that are new in v15
Compiling with -Wshadow=compatible-local yields quite a few warnings about local variables being shadowed by compatible local variables in an inner scope. Of course, this is perfectly valid in C, but we have had bugs in the past as a result of developers failing to notice this. af7d270dd is a recent example. Here we do a cleanup of warnings we receive from -Wshadow=compatible-local for code which is new to PostgreSQL 15. We've yet to have the discussion about if we actually ever want to run that as a standard compilation flag. We'll need to at least get the number of warnings down to something easier to manage before we can realistically consider if we want this or not. This commit is the first step towards reducing the warnings. The changes being made here are all fairly trivial. Because of that, and the fact that v15 is still in beta, this is being back-patched into 15. It seems more risky not to do this as the risk of future bugs is increased by the additional conflicts that this commit could cause for any future bug fixes touching the same areas as this commit. Author: Justin Pryzby Discussion: https://postgr.es/m/20220817145434.GC26426%40telsasoft.com Backpatch-through: 15
Diffstat (limited to 'src/backend/utils/adt/jsonpath_exec.c')
-rw-r--r--src/backend/utils/adt/jsonpath_exec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 10c7e64aab3..560f9b13ab8 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -3109,10 +3109,10 @@ JsonItemFromDatum(Datum val, Oid typid, int32 typmod, JsonbValue *res)
if (JsonContainerIsScalar(&jb->root))
{
- bool res PG_USED_FOR_ASSERTS_ONLY;
+ bool result PG_USED_FOR_ASSERTS_ONLY;
- res = JsonbExtractScalar(&jb->root, jbv);
- Assert(res);
+ result = JsonbExtractScalar(&jb->root, jbv);
+ Assert(result);
}
else
JsonbInitBinary(jbv, jb);