]> xenbits.xensource.com Git - xen.git/commitdiff
x86/emul: auxiliary definition of pseudo keyword fallthrough
authorFederico Serafini <federico.serafini@bugseng.com>
Thu, 14 Nov 2024 12:02:02 +0000 (13:02 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 14 Nov 2024 12:02:02 +0000 (13:02 +0100)
The pseudo keyword fallthrough shall be used to make explicit the
fallthrough intention at the end of a case statement (doing this
using comments is deprecated).

A definition of such pseudo keyword is already present in the
Xen build. This auxiliary definition makes it available also for
for test and fuzzing harness without iterfearing with the one
that the Xen build has.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
tools/tests/x86_emulator/x86-emulate.h

index 00abc829b0a2103db50f1866b3708bbc9c8b9abb..929c1a72ae881232e8f3f0ffb4264dab327b969c 100644 (file)
 
 #define cf_check /* No Control Flow Integriy checking */
 
+/*
+ * Pseudo keyword 'fallthrough' to make explicit the fallthrough intention at
+ * the end of a case statement block.
+ */
+#if !defined(__clang__) && (__GNUC__ >= 7)
+# define fallthrough        __attribute__((__fallthrough__))
+#else
+# define fallthrough        do {} while (0)  /* fallthrough */
+#endif
+
 #ifdef __GCC_ASM_FLAG_OUTPUTS__
 # define ASM_FLAG_OUT(yes, no) yes
 #else