[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/emul: auxiliary definition of pseudo keyword fallthrough



commit 5bf8f2f5ccbf3bc18c718b4a51120cccfbfbbade
Author:     Federico Serafini <federico.serafini@xxxxxxxxxxx>
AuthorDate: Thu Nov 14 13:02:02 2024 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Nov 14 13:02:02 2024 +0100

    x86/emul: auxiliary definition of 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
    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@xxxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 tools/tests/x86_emulator/x86-emulate.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/tests/x86_emulator/x86-emulate.h 
b/tools/tests/x86_emulator/x86-emulate.h
index 00abc829b0..929c1a72ae 100644
--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -56,6 +56,16 @@
 
 #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
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.