Suppress "variable 'pagesaving' set but not used" warning.
authorTom Lane
Wed, 6 Apr 2022 21:03:35 +0000 (17:03 -0400)
committerTom Lane
Wed, 6 Apr 2022 21:03:50 +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 3e11805293a99fe77acc4a6d2a0d05879f072e93..0207421a5d977204f11a58c630859b1247a2e042 100644 (file)
@@ -65,7 +65,7 @@ _bt_dedup_pass(Relation rel, Buffer buf, Relation heapRel, IndexTuple newitem,
    BTPageOpaque opaque = BTPageGetOpaque(page);
    Page        newpage;
    BTDedupState state;
-   Size        pagesaving = 0;
+   Size        pagesaving PG_USED_FOR_ASSERTS_ONLY = 0;
    bool        singlevalstrat = false;
    int         nkeyatts = IndexRelationGetNumberOfKeyAttributes(rel);