HomeFreeBSD

Disable -Wzero-length-bounds for the kernel for GCC 12.

Description

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

Details

Provenance
jhbAuthored on Dec 21 2022, 6:47 PM
Reviewer
hselasky
Differential Revision
D37630: Disable -Wzero-length-bounds for the kernel for GCC 12.
Parents
rG2637ed558baa: Disable -Wdangling-pointer for the kernel for GCC 12.
Branches
Unknown
Tags
Unknown