From: Tom Lane Date: Wed, 6 Apr 2022 21:03:35 +0000 (-0400) Subject: Suppress "variable 'pagesaving' set but not used" warning. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=dbafe127bb215f512164669b49f99fcb7ed9d266;p=users%2Frhaas%2Fpostgres.git Suppress "variable 'pagesaving' set but not used" warning. 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 --- diff --git a/src/backend/access/nbtree/nbtdedup.c b/src/backend/access/nbtree/nbtdedup.c index 3e11805293..0207421a5d 100644 --- a/src/backend/access/nbtree/nbtdedup.c +++ b/src/backend/access/nbtree/nbtdedup.c @@ -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);