HomeFreeBSD

Silence unused-but-set-variable warnings

Description

Silence unused-but-set-variable warnings

Clang 13.0.0 added support for Wunused-but-set-parameter and
-Wunused-but-set-variable which correctly detects two unused
variables in zstd resulting in a build failure. This commit
annotates these instances accordingly.

https://releases.llvm.org/13.0.1/tools/clang/docs/ReleaseNotes.html#id6

In FSE_createCTable(), malloc() is intentionally defined as NULL when
compiled in the kernel so the variable is unused.

zstd/lib/compress/fse_compress.c:307:12: error: variable 'size'
set but not used [-Werror,-Wunused-but-set-variable]

Additionally, in ZSTD_seqDecompressedSize() the assert is compiled
out similarly resulting in an unused variable.

zstd/lib/compress/zstd_compress_superblock.c:412:12: error: variable
'litLengthSum' set but not used [-Werror,-Wunused-but-set-variable]

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Apr 29 2022, 5:11 PM
Parents
rGecec151c149b: module: zfs: freebsd: fix unused, remove argsused
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG4c9c96aba402: Silence unused-but-set-variable warnings (authored by Brian Behlendorf <behlendorf1@llnl.gov>).May 2 2022, 10:42 PM