Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Sep 2021 23:58:59 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f4fed768bba4 - stable/12 - Don't error out on unused but set variables with clang 13
Message-ID:  <202109022358.182Nwxvq011012@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by dim:

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

commit f4fed768bba45a406f73ed1491d7e52fd1a8711d
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-08-29 13:53:40 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-09-02 23:30:30 +0000

    Don't error out on unused but set variables with clang 13
    
    Clang 13.0.0 now has a -Wunused-but-set-variable warning similar to the
    one gcc has had for quite a while. Since this triggers *very* often for
    our kernel builds, don't make it a hard error, but leave the warning
    visible so is some incentive to fix the instances.
    
    (cherry picked from commit 395d46caaed73228b84dfaeb37c702304a46ba8f)
---
 sys/conf/kern.mk | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index d87752649679..34ffc8cb15ca 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -25,6 +25,9 @@ NO_WUNNEEDED_INTERNAL_DECL=	-Wno-error=unneeded-internal-declaration
 NO_WSOMETIMES_UNINITIALIZED=	-Wno-error=sometimes-uninitialized
 NO_WCAST_QUAL=			-Wno-error=cast-qual
 NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare
+.if ${COMPILER_VERSION} >= 100000
+NO_WMISLEADING_INDENTATION=	-Wno-misleading-indentation
+.endif
 # Several other warnings which might be useful in some cases, but not severe
 # enough to error out the whole kernel build.  Display them anyway, so there is
 # some incentive to fix them eventually.
@@ -33,8 +36,8 @@ 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} >= 100000
-NO_WMISLEADING_INDENTATION=	-Wno-misleading-indentation
+.if ${COMPILER_VERSION} >= 130000
+CWARNFLAGS+=	-Wno-error=unused-but-set-variable
 .endif
 .endif	# clang
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109022358.182Nwxvq011012>