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 f4fed768bb which did the same for the
kernel builds.

Reviewed by:	arichardson, imp
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D31927
This commit is contained in:
Dimitry Andric 2021-08-26 17:36:03 +02:00
parent b029ef7fe6
commit 45feade38e

View File

@ -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\