Suppress "warning: variable 'collcollate' set but not used".
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Nov 2020 17:39:49 +0000 (12:39 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Nov 2020 17:39:49 +0000 (12:39 -0500)
Buildfarm members that lack both HAVE_LOCALE_T and USE_ICU have been
complaining about pg_newlocale_from_collation's collcollate variable.
This is evidently fallout from commit 7d1297df0, which removed the
only usage outside those two #ifdef'd code paths.  Mark the variable
pg_attribute_unused(), like its sibling collctype, which has been that
way for a long time.

src/backend/utils/adt/pg_locale.c

index 1dfe343b79ca17aecccdcba5ccb74fbdd1191d84..cc4bf3b50096e1952a5037c55455dc22e939ee90 100644 (file)
@@ -1514,7 +1514,7 @@ pg_newlocale_from_collation(Oid collid)
        /* We haven't computed this yet in this session, so do it */
        HeapTuple   tp;
        Form_pg_collation collform;
-       const char *collcollate;
+       const char *collcollate pg_attribute_unused();
        const char *collctype pg_attribute_unused();
        struct pg_locale_struct result;
        pg_locale_t resultp;