Bug: https://bugs.gentoo.org/981874
From https://gitlab.gnome.org/GNOME/pango/-/merge_requests/927
From: Daniel Nylander <yeager@users.noreply.gitlab.gnome.org>
Date: Fri, 11 Sep 2026 23:05:39 +0200
Subject: [PATCH 1/3] build: Do not promote unused globals to errors with Clang

--- a/meson.build
+++ b/meson.build
@@ -148,6 +148,7 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
     '-Werror=empty-body',
     '-Werror=write-strings',
     '-Werror=unused-but-set-variable',
+    '-Wno-error=unused-but-set-global',
     '-Wundef', # FIXME: https://bugzilla.gnome.org/show_bug.cgi?id=792481
   ]
 
-- 
GitLab


From: Daniel Nylander <yeager@users.noreply.gitlab.gnome.org>
Date: Sat, 12 Sep 2026 10:37:21 +0200
Subject: [PATCH 2/3] build: Probe unused global warning override

--- a/meson.build
+++ b/meson.build
@@ -148,10 +148,13 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
     '-Werror=empty-body',
     '-Werror=write-strings',
     '-Werror=unused-but-set-variable',
-    '-Wno-error=unused-but-set-global',
     '-Wundef', # FIXME: https://bugzilla.gnome.org/show_bug.cgi?id=792481
   ]
 
+  test_cflags += cc.get_supported_arguments([
+    '-Wno-error=unused-but-set-global',
+  ])
+
   if host_system == 'windows'
     test_cflags += [ '-mms-bitfields' ]
   else
-- 
GitLab

