From f996d026afc4e3c6509f7d5735493b952c6c36f9 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 13 Nov 2024 13:50:44 +0000 Subject: [PATCH] grefstring: Mark a variable as potentially unused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is unused when compiling with `G_DISABLE_ASSERT`. That’s fine, but we definitely want the `g_hash_table_remove()` call to still be made. Fixes this CI failure: https://gitlab.gnome.org/GNOME/glib/-/jobs/4483098 Signed-off-by: Philip Withnall --- glib/grefstring.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glib/grefstring.c b/glib/grefstring.c index b1c07f735..9f8900e5b 100644 --- a/glib/grefstring.c +++ b/glib/grefstring.c @@ -279,7 +279,9 @@ retry: /* If the string was not given out again in the meantime we're done */ if (g_atomic_int_dec_and_test (&impl->ref_count)) { - gboolean removed = g_hash_table_remove (interned_ref_strings, str); + gboolean removed G_GNUC_UNUSED /* when compiling with G_DISABLE_ASSERT */; + + removed = g_hash_table_remove (interned_ref_strings, str); g_assert (removed); if (g_hash_table_size (interned_ref_strings) == 0)