Silence unused-but-set-variable warnings
commit1bf3abc6343bc5b14c13bc402ffcdd4bbd6c7f40
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 29 Apr 2022 21:21:11 +0000 (29 14:21 -0700)
committerGitHub <noreply@github.com>
Fri, 29 Apr 2022 21:21:11 +0000 (29 14:21 -0700)
treeda1046c10863019a50ec7841a74d8f4ef53c96b9
parentf2330bd1568489ae1fb16d975a5a9bcfe12ed219
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]

Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13382
module/zstd/lib/compress/fse_compress.c
module/zstd/lib/compress/zstd_compress_superblock.c