Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Sep 2021 16:07:03 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 45feade38ec3 - main - Add -Wno-error=unused-but-set-variable when building with Clang 13+
Message-ID:  <202109131607.18DG73f4052474@gitrepo.freebsd.org>

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

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

commit 45feade38ec3e8e30086dedc6ee81cbf816293e3
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-08-26 15:36:03 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-09-13 16:05:43 +0000

    Add -Wno-error=unused-but-set-variable when building with Clang 13+
    
    This warning triggers many times while building world. Downgrade it to a
    warning until all occurrences have been fixed. Once the Clang warnings
    have been fixed we should be able to turn it on for GCC as well. See
    also f4fed768bba45a406f73ed1491d7e52fd1a8711d which did the same for the
    kernel builds.
    
    Reviewed by:    arichardson, imp
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D31927
---
 share/mk/bsd.sys.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index a4bb54e19890..304d8dd7d243 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -80,6 +80,9 @@ CWARNFLAGS+=	-Wno-pointer-sign
 .if ${WARNS} <= 6
 CWARNFLAGS.clang+=	-Wno-empty-body -Wno-string-plus-int
 CWARNFLAGS.clang+=	-Wno-unused-const-variable
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 130000
+CWARNFLAGS.clang+=	-Wno-error=unused-but-set-variable
+.endif
 .endif # WARNS <= 6
 .if ${WARNS} <= 3
 CWARNFLAGS.clang+=	-Wno-tautological-compare -Wno-unused-value\



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