HomeFreeBSD

Fix compiler warnings about zero-length arrays in inline bitops

Description

Fix compiler warnings about zero-length arrays in inline bitops

The compiler appears to be expanding the unused NULL pointer into a
zero-length array via the inline bitops code. When -Werror=array-bounds
is used, this causes a build failure. Recommended solution is allocate
temporary structures, fill with zeros (to avoid uninitialized data use
warnings), and pass the pointer to those to the inline calls.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #13463
Closes #13465

Details

Provenance
Coleman Kane <ckane@colemankane.org>Authored on May 17 2022, 8:07 PM
GitHub <noreply@github.com>Committed on May 17 2022, 8:07 PM
Parents
rG276b08cb0077: linux: libzutil: zfs_strip_path: only strip known prefixes
Branches
Unknown
Tags
Unknown