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
Brian Behlendorf <behlendorf1@llnl.gov>Committed on May 20 2022, 5:33 PM
Parents
rG0112bc23129c: Add missing AC_MSG_RESULT(no) to configure
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG05147319b082: Fix compiler warnings about zero-length arrays in inline bitops (authored by Coleman Kane <ckane@colemankane.org>).May 20 2022, 5:33 PM