mirror of
https://github.com/facebook/zstd.git
synced 2025-06-15 06:21:46 +03:00
[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.
This commit is contained in:
@ -18,4 +18,6 @@
|
||||
#define noinline __attribute__((noinline))
|
||||
#endif
|
||||
|
||||
#define fallthrough __attribute__((__fallthrough__))
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user