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 395d46caae
)
This commit is contained in:
parent
4409857538
commit
f4fed768bb
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user