[RFC PATCH] KVM: s390: selftests: work around macro is_signed_type re-definiton

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

 



The following commit creates a pre-processor warning during the KVM
selftest build as it leads to a re-definition of macro is_signed_type().

  commit fc92099902fb ("tools headers: Synchronize linux/bits.h with the kernel sources")

  $ make -C tools/testing/selftests TARGETS="kvm" all >/dev/null
  In file included from s390/ucontrol_test.c:11:
  ../kselftest_harness.h:754:9: warning: ‘is_signed_type’ redefined
    754 | #define is_signed_type(var)       (!!(((__typeof__(var))(-1)) < (__typeof__(var))1))
        |         ^~~~~~~~~~~~~~
  In file included from ./linux/tools/testing/selftests/../../../tools/include/linux/bits.h:34,
                   from ./linux/tools/testing/selftests/../../../tools/include/linux/bitops.h:14,
                   from ./linux/tools/testing/selftests/../../../tools/include/linux/hashtable.h:13,
                   from include/kvm_util.h:11,
                   from include/s390/debug_print.h:15,
                   from s390/ucontrol_test.c:10:
  ./linux/tools/testing/selftests/../../../tools/include/linux/overflow.h:31:9: note: this is the location of the previous definition
     31 | #define is_signed_type(type)       (((type)(-1)) < (type)1)
     	|         ^~~~~~~~~~~~~~
  cc1: note: unrecognized command-line option ‘-Wno-gnu-variable-sized-type-not-at-end’ may have been intended to silence earlier diagnostics

A fix resolving this issue outside this kvm selftest would be preferred.

Signed-off-by: Michael Mueller <mimu@xxxxxxxxxxxxx>
---
 tools/testing/selftests/kvm/s390/ucontrol_test.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/testing/selftests/kvm/s390/ucontrol_test.c b/tools/testing/selftests/kvm/s390/ucontrol_test.c
index d265b34c54be..d1258c1568db 100644
--- a/tools/testing/selftests/kvm/s390/ucontrol_test.c
+++ b/tools/testing/selftests/kvm/s390/ucontrol_test.c
@@ -8,6 +8,16 @@
  *  Christoph Schlameuss <schlameuss@xxxxxxxxxxxxx>
  */
 #include "debug_print.h"
+
+/*
+ * header debug_print.h leaves macro is_signed_type()
+ * behind which is defined in "linux/overflow.h"
+ * header "kselftest_harness.h" re-defines it.
+ */
+#ifdef is_signed_type
+#undef is_signed_type
+#endif
+
 #include "kselftest_harness.h"
 #include "kvm_util.h"
 #include "processor.h"
-- 
2.50.1





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux