suppress set but not used warnings for kernel builds
Use -Wno-unused-but-set-variable for kernel builds with clang13.
To turn this warning back on, set the following in src.conf:
WITH_SET_BUT_NOTUSED_KERNEL_WARNINGS=
Reviewed by: mjg, imp
Differential Revision: https://reviews.freebsd.org/D34784
This commit is contained in:
+5
-1
@@ -43,7 +43,11 @@ CWARNEXTRA?= -Wno-error=tautological-compare -Wno-error=empty-body \
|
||||
CWARNEXTRA+= -Wno-error=shift-negative-value
|
||||
CWARNEXTRA+= -Wno-address-of-packed-member
|
||||
.if ${COMPILER_VERSION} >= 130000
|
||||
CWARNFLAGS+= -Wno-error=unused-but-set-variable
|
||||
.if ${MK_SET_BUT_NOTUSED_KERNEL_WARNINGS} == "no"
|
||||
CWARNEXTRA+= ${NO_WUNUSED_BUT_SET_VARIABLE}
|
||||
.else
|
||||
CWARNEXTRA+= -Wno-error=unused-but-set-variable
|
||||
.endif
|
||||
.endif
|
||||
.endif # clang
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ __DEFAULT_NO_OPTIONS = \
|
||||
INIT_ALL_ZERO \
|
||||
KERNEL_RETPOLINE \
|
||||
RATELIMIT \
|
||||
REPRODUCIBLE_BUILD
|
||||
REPRODUCIBLE_BUILD \
|
||||
SET_BUT_NOTUSED_KERNEL_WARNINGS
|
||||
|
||||
# Some options are totally broken on some architectures. We disable
|
||||
# them. If you need to enable them on an experimental basis, you
|
||||
|
||||
Reference in New Issue
Block a user