postgres.git / summary / log / commit / refs

commit    b28c6c443e4001708e8f6d38f0868ac239452caa
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 f944453a1d8..02a6bed334e 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -85,7 +85,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 cb1505b440e..c8d8d6e6b79 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: ce2648b16ab8]