diff options
author | Brian Behlendorf <[email protected]> | 2021-09-14 09:17:54 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2021-09-14 10:17:54 -0600 |
commit | 6954c22f35cc8182f76bd18ab259a7d3eaf40b65 (patch) | |
tree | 0397dcd7c2fb6dd73754d30e0ad61feeff62625c /lib/libspl/include | |
parent | 7443299fe0b8caaadbfc18f778732bb26c899e41 (diff) |
Use fallthrough macro
As of the Linux 5.9 kernel a fallthrough macro has been added which
should be used to anotate all intentional fallthrough paths. Once
all of the kernel code paths have been updated to use fallthrough
the -Wimplicit-fallthrough option will because the default. To
avoid warnings in the OpenZFS code base when this happens apply
the fallthrough macro.
Additional reading: https://lwn.net/Articles/794944/
Reviewed-by: Tony Nguyen <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #12441
Diffstat (limited to 'lib/libspl/include')
-rw-r--r-- | lib/libspl/include/sys/feature_tests.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libspl/include/sys/feature_tests.h b/lib/libspl/include/sys/feature_tests.h index 1a68b75f0..a36fd7b8c 100644 --- a/lib/libspl/include/sys/feature_tests.h +++ b/lib/libspl/include/sys/feature_tests.h @@ -27,6 +27,15 @@ #ifndef _SYS_FEATURE_TESTS_H #define _SYS_FEATURE_TESTS_H -#define __NORETURN __attribute__((__noreturn__)) +#define ____cacheline_aligned +#define __NORETURN __attribute__((__noreturn__)) + +#if !defined(fallthrough) +#if defined(HAVE_IMPLICIT_FALLTHROUGH) +#define fallthrough __attribute__((__fallthrough__)) +#else +#define fallthrough ((void)0) +#endif +#endif #endif |