From: Noah Misch Date: Sun, 3 Nov 2024 02:42:52 +0000 (-0700) Subject: Suppress new "may be used uninitialized" warning. X-Git-Tag: REL_18_BETA1~1562 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=825c72c071969bede8e15846a89a3bfa5b1be66b;p=postgresql.git Suppress new "may be used uninitialized" warning. Buildfarm member mamba fails to deduce that the function never uses this variable without initializing it. Back-patch to v12, like commit b412f402d1e020c5dac94f3bf4a005db69519b99. --- diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index bc01a3e93c5..f9bb721c5fe 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -2807,8 +2807,8 @@ index_update_stats(Relation rel, double reltuples) { bool update_stats; - BlockNumber relpages; - BlockNumber relallvisible; + BlockNumber relpages = 0; /* keep compiler quiet */ + BlockNumber relallvisible = 0; Oid relid = RelationGetRelid(rel); Relation pg_class; ScanKeyData key[1]; @@ -2849,8 +2849,6 @@ index_update_stats(Relation rel, if (rel->rd_rel->relkind != RELKIND_INDEX) visibilitymap_count(rel, &relallvisible, NULL); - else /* don't bother for indexes */ - relallvisible = 0; } /*