mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 09:11:07 -04:00
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
This commit is contained in:
parent
2637ed558b
commit
1aa6d44dec
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue