git: a0bb961dde2f - stable/14 - kern.mk: make clang 23 -Wunused-but-set-global non-fatal

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sun, 20 Sep 2026 07:03:46 UTC
The branch stable/14 has been updated by dim:

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

commit a0bb961dde2f8b56d7bd4a107d1fa7e0db48d855
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-09-17 19:36:25 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-09-20 07:03:13 +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
    
    (cherry picked from commit bcd0d76d4882dd8d19a49c050411b5c58a0deb74)
---
 sys/conf/kern.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index daa637f038eb..9226282a07b5 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"