mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-05 03:41:13 +03:00
Introduced macro to silence implicit-fallthrough warning
The fallthrough comment is not enough to silence the warning with -Wimplicit-fallthrough=5. This commit also fixes submodule handling in github actions.
This commit is contained in:
@ -34,8 +34,11 @@
|
||||
* left empty.
|
||||
* WSREP_UNUSED - Can be used to mark variables which may be present in
|
||||
* debug builds but not in release builds.
|
||||
* WSREP_FALLTHROUGH - Silence implicit fallthrough warning.
|
||||
*/
|
||||
|
||||
#ifndef WSREP_LIB_COMPILER_HPP
|
||||
#define WSREP_LIB_COMPILER_HPP
|
||||
|
||||
#if __cplusplus >= 201103L && !(__GNUC__ == 4 && __GNUG_MINOR__ < 8)
|
||||
#define WSREP_NORETURN [[noreturn]]
|
||||
@ -51,3 +54,17 @@
|
||||
#define WSREP_OVERRIDE
|
||||
#endif // __cplusplus >= 201103L
|
||||
#define WSREP_UNUSED __attribute__((unused))
|
||||
|
||||
#if __GNUC__ >= 7
|
||||
#define WSREP_FALLTHROUGH __attribute__((fallthrough))
|
||||
#elif defined(__clang__)
|
||||
# if defined(__has_warning)
|
||||
# if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
|
||||
# define WSREP_FALLTHROUGH [[clang::fallthrough]]
|
||||
# endif
|
||||
# endif
|
||||
#else // __clang __
|
||||
#define WSREP_FALLTHROUGH ((void)0)
|
||||
#endif // __GNUC__ >= 7 || (__clang__ && __clang_major__ >= 10)
|
||||
|
||||
#endif // WSREP_LIB_COMPILER_HPP
|
||||
|
Reference in New Issue
Block a user