[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XEN PATCH 1/3] x86/emul: define pseudo keyword fallthrough
The pseudo keyword fallthrough shall be used to make explicit the fallthrough intention at the end of a case statement (doing this through comments is deprecated). Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx> --- xen/arch/x86/x86_emulate/x86_emulate.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h index d75658eba0..f49b1e0dd8 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.h +++ b/xen/arch/x86/x86_emulate/x86_emulate.h @@ -23,6 +23,16 @@ # error Unknown compilation width #endif +/* + * Pseudo keyword 'fallthrough' to make explicit the fallthrough intention at + * the end of a case statement. + */ +#if (!defined(__clang__) && (__GNUC__ >= 7)) +# define fallthrough __attribute__((__fallthrough__)) +#else +# define fallthrough do {} while (0) /* fallthrough */ +#endif + struct x86_emulate_ctxt; /* -- 2.43.0
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |