git: bcd0d76d4882 - main - kern.mk: make clang 23 -Wunused-but-set-global non-fatal

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Thu, 17 Sep 2026 19:37:11 UTC
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=bcd0d76d4882dd8d19a49c050411b5c58a0deb74

commit bcd0d76d4882dd8d19a49c050411b5c58a0deb74
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-09-17 19:36:25 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-09-17 19:36:46 +0000

    kern.mk: make clang 23 -Wunused-but-set-global non-fatal
    
    This warning triggers in a few places in contributed code, and would
    therefore be annoying to fix. Use -Wno-error= to at least show the
    warnings so there is some incentive to submit them upstream.
    
    MFC after:      3 days
---
 sys/conf/kern.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 3c3442e63d31..83881cc05b94 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -48,6 +48,9 @@ CWARNEXTRA?=	-Wno-error=tautological-compare -Wno-error=empty-body \
 		-Wno-error=pointer-sign
 CWARNEXTRA+=	-Wno-error=shift-negative-value
 CWARNEXTRA+=	-Wno-address-of-packed-member
+.if ${COMPILER_VERSION} >= 230000
+CWARNEXTRA+=	-Wno-error=unused-but-set-global
+.endif
 .endif	# clang
 
 .if ${COMPILER_TYPE} == "gcc"