gcc-7.5 on openSUSE 15:
error: this statement may fall through [-Werror=implicit-fallthrough=]
Use the __attribute__((fallthrough)) for gcc-7 and later.
and use a no op statement for earlier gcc where the fallthrough
attribute is not available.
Test-Parameters: trivial
Fixes:
5549b1b9e0 ("LU-15220 lustre: use 'fallthrough' pseudo keyword for switch")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: Ib72f5996149c738805f15e354e1e1606d981ce29
Reviewed-on: https://review.whamcloud.com/46357
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#endif
#ifndef fallthrough
-#define fallthrough do {} while (0) /* fallthrough */
+# if defined(__GNUC__) && __GNUC__ >= 7
+# define fallthrough __attribute__((fallthrough)) /* fallthrough */
+# else
+# define fallthrough do {} while (0) /* fallthrough */
+# endif
#endif
int choose_ipv4_src(__u32 *ret,
#endif
#ifndef fallthrough
-#define fallthrough do {} while (0) /* fallthrough */
+# if defined(__GNUC__) && __GNUC__ >= 7
+# define fallthrough __attribute__((fallthrough)) /* fallthrough */
+# else
+# define fallthrough do {} while (0) /* fallthrough */
+# endif
#endif
typedef struct statx lstatx_t;
#endif
#ifndef fallthrough
-#define fallthrough do {} while (0) /* fallthrough */
+# if defined(__GNUC__) && __GNUC__ >= 7
+# define fallthrough __attribute__((fallthrough)) /* fallthrough */
+# else
+# define fallthrough do {} while (0) /* fallthrough */
+# endif
#endif
static inline void ll_security_release_secctx(char *secdata, u32 seclen)
#include "write_bytes.h"
#ifndef fallthrough
-#define fallthrough do {} while (0) /* fallthrough */
+# if defined(__GNUC__) && __GNUC__ >= 7
+# define fallthrough __attribute__((fallthrough)) /* fallthrough */
+# else
+# define fallthrough do {} while (0) /* fallthrough */
+# endif
#endif
extern char *this_realm;