]> git.ipfire.org Git - thirdparty/zstd.git/commit
[lib] Make lib compatible with `-Wfall-through` excepting legacy 2796/head
authorNick Terrell <terrelln@fb.com>
Thu, 23 Sep 2021 02:56:07 +0000 (19:56 -0700)
committerNick Terrell <terrelln@fb.com>
Thu, 23 Sep 2021 17:51:18 +0000 (10:51 -0700)
commit189e87bcbeb1aa527a82f80adfe6e356de6ab555
tree162c850b615d5d2c70123a99c2ea9492a6dd3557
parente3feec74d37644ddd91749d0bcc12388d626f77b
[lib] Make lib compatible with `-Wfall-through` excepting legacy

Switch to a macro `ZSTD_FALLTHROUGH;` instead of a comment. On supported
compilers this uses an attribute, otherwise it becomes a comment.

This is necessary to be compatible with clang's `-Wfall-through`, and
gcc's `-Wfall-through=2` which don't support comments. Without this the
linux build emits a bunch of warnings.

Also add a test to CI to ensure that we don't regress.
.github/workflows/dev-short-tests.yml
contrib/linux-kernel/Makefile
contrib/linux-kernel/test/include/linux/compiler.h
lib/common/bitstream.h
lib/common/compiler.h
lib/compress/huf_compress.c
lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h
lib/compress/zstd_double_fast.c
lib/decompress/zstd_decompress.c
lib/decompress/zstd_decompress_block.c