From 55c15ad9ded2707d16cb88eea2dc2a62e4ec2359 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 24 May 2017 17:23:54 +0200 Subject: Cycles: Use falltrhough attribute to help catching missing break statements --- intern/cycles/util/util_types.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'intern/cycles/util') diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h index 0039c59ec48..a5d1d7152d5 100644 --- a/intern/cycles/util/util_types.h +++ b/intern/cycles/util/util_types.h @@ -68,6 +68,13 @@ # define ccl_never_inline __attribute__((noinline)) # define ccl_maybe_unused __attribute__((used)) # endif /* _WIN32 && !FREE_WINDOWS */ + +/* Use to suppress '-Wimplicit-fallthrough' (in place of 'break'). */ +# if defined(__GNUC__) && (__GNUC__ >= 7) /* gcc7.0+ only */ +# define ATTR_FALLTHROUGH __attribute__((fallthrough)) +# else +# define ATTR_FALLTHROUGH ((void)0) +# endif #endif /* __KERNEL_GPU__ */ /* Standard Integer Types */ -- cgit v1.2.3