aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-12-21 18:47:08 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-12-21 18:48:15 +0000
commit1aa6d44decb33ce3eab0efe5336b75fa2dfa3733 (patch)
tree9ebdeb0b3c28119f07348c3eb9ca17feb43d8b28
parent2637ed558baacdab7a8cf789dca713bde5843e43 (diff)
downloadsrc-1aa6d44decb33ce3eab0efe5336b75fa2dfa3733.tar.gz
src-1aa6d44decb33ce3eab0efe5336b75fa2dfa3733.zip
Disable -Wzero-length-bounds for the kernel for GCC 12.
The mlx5 driver and some other OFED bits use a somewhat dubious pattern of: struct foo { uint64_t arg[0]; /* Real members of a struct */ }; The code then treats 'arg' as if it were really a kind of union such that foo.arg[N] functions similarly to (uint64_t *)foo[N]. This uses of foo.arg[N] then trigger this warning. No real bugs were found by this warning though, so just turn it off globally. Reviewed by: hselasky, kib Differential Revision: https://reviews.freebsd.org/D37630
-rw-r--r--sys/conf/kern.mk3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 5231a289981e..65cf86375cce 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -79,7 +79,8 @@ CWARNEXTRA+= -Wno-address-of-packed-member \
-Wno-error=alloca-larger-than=
.if ${COMPILER_VERSION} >= 120100
CWARNEXTRA+= -Wno-error=nonnull \
- -Wno-dangling-pointer
+ -Wno-dangling-pointer \
+ -Wno-zero-length-bounds
.endif
.endif