git: 2814ba8ef17a - main - Move NO_WUNUSED_BUT_SET_VARIABLE clang helper to the right place.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 14 Mar 2022 21:06:00 UTC
The branch main has been updated by jhb:

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

commit 2814ba8ef17aa647fa52092106731bcf76a2392d
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-03-14 21:05:25 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-03-14 21:05:25 +0000

    Move NO_WUNUSED_BUT_SET_VARIABLE clang helper to the right place.
    
    Reviewed by:    imp, dim, emaste
    Sponsored by:   University of Cambridge, Google, Inc.
    Differential Revision:  https://reviews.freebsd.org/D34537
---
 sys/conf/kern.mk | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index c1228ed1bc6f..f97be774ea10 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -28,6 +28,9 @@ NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare
 .if ${COMPILER_VERSION} >= 100000
 NO_WMISLEADING_INDENTATION=	-Wno-misleading-indentation
 .endif
+.if ${COMPILER_VERSION} >= 130000
+NO_WUNUSED_BUT_SET_VARIABLE=	-Wno-unused-but-set-variable
+.endif
 .if ${COMPILER_VERSION} >= 140000
 NO_WBITWISE_INSTEAD_OF_LOGICAL=	-Wno-bitwise-instead-of-logical
 .endif
@@ -90,10 +93,6 @@ CWARNFLAGS+=	-Wno-format-zero-length
 FORMAT_EXTENSIONS=	-Wno-format
 .elif ${COMPILER_TYPE} == "clang"
 FORMAT_EXTENSIONS=	-D__printf__=__freebsd_kprintf__
-# Only newer versions of clang have -Wno-unused-but-set-variable
-.if ${COMPILER_VERSION} >= 130000
-NO_WUNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable
-.endif
 .else
 FORMAT_EXTENSIONS=	-fformat-extensions
 .endif