]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Suppress "variable 'pagesaving' set but not used" warning.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 6 Apr 2022 21:03:35 +0000 (17:03 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 6 Apr 2022 21:03:35 +0000 (17:03 -0400)
With asserts disabled, late-model clang notices that this variable
is incremented but never otherwise read.

Discussion: https://postgr.es/m/3171401.1649275153@sss.pgh.pa.us

src/backend/access/nbtree/nbtdedup.c

index 6401fce57b91ef38fc4e09b175c831078f26d754..1cd1b59ec35b21ab95d134771cfe59e0766f9604 100644 (file)
@@ -64,7 +64,7 @@ _bt_dedup_pass(Relation rel, Buffer buf, Relation heapRel, IndexTuple newitem,
        BTPageOpaque opaque = (BTPageOpaque) PageGetSpecialPointer(page);
        Page            newpage;
        BTDedupState state;
-       Size            pagesaving = 0;
+       Size            pagesaving PG_USED_FOR_ASSERTS_ONLY = 0;
        bool            singlevalstrat = false;
        int                     nkeyatts = IndexRelationGetNumberOfKeyAttributes(rel);