postgres.git / summary / log / commit / refs
commit f13dbbf753524fe2421e310d0b5a3e85fb38ab5e
Author: Peter Eisentraut <peter@eisentraut.org>
Date: Tue Sep 22 17:30:29 2026 +0000
Silence warnings about unused global variables
Similar to commit "Remove unused global variables", silence
-Wunused-but-set-global warnings from clang 23 (included in -Wall).
These are variables that are used in assert-enabled builds only, so
annotate them with PG_USED_FOR_ASSERTS_ONLY.
src/backend/utils/cache/syscache.c | 2 +-
src/test/modules/test_resowner/test_resowner_many.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c
index f4233f9e31a..9db29027fd8 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -86,7 +86,7 @@ StaticAssertDecl(lengthof(cacheinfo) == SysCacheSize,
static CatCache *SysCache[SysCacheSize];
-static bool CacheInitialized = false;
+static bool CacheInitialized PG_USED_FOR_ASSERTS_ONLY = false;
/* Sorted array of OIDs of tables that have caches on them */
static Oid SysCacheRelationOid[SysCacheSize];
diff --git a/src/test/modules/test_resowner/test_resowner_many.c b/src/test/modules/test_resowner/test_resowner_many.c
index 8a836759134..e2f2b5bd967 100644
--- a/src/test/modules/test_resowner/test_resowner_many.c
+++ b/src/test/modules/test_resowner/test_resowner_many.c
@@ -46,7 +46,7 @@ typedef struct
* Priority of last call to the release callback.
* This is used to check that the resources are released in correct order.
*/
-static uint32 last_release_priority = 0;
+static uint32 last_release_priority PG_USED_FOR_ASSERTS_ONLY = 0;
/* prototypes for local functions */
static void ReleaseManyTestResource(Datum res);
[parent: b73d13c32c83]