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

[Xen-devel] [PATCH] remove the use of -Wno-unused-value



It has been hiding actual mistakes, and there are not too many changes
necessary to make things build without suppressing this warning.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- 2011-12-12.orig/Config.mk   2011-12-12 15:46:14.000000000 +0100
+++ 2011-12-12/Config.mk        2011-11-30 17:49:42.000000000 +0100
@@ -157,10 +157,6 @@ CFLAGS += -std=gnu99
 
 CFLAGS += -Wall -Wstrict-prototypes
 
-# -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
-# result of any casted expression causes a warning.
-CFLAGS += -Wno-unused-value
-
 # Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
 # and is over-zealous with the printf format lint
 CFLAGS-$(clang) += -Wno-parentheses -Wno-format
--- 2011-12-12.orig/tools/libfsimage/common/fsimage_grub.h      2010-04-19 
09:12:58.000000000 +0200
+++ 2011-12-12/tools/libfsimage/common/fsimage_grub.h   2011-12-12 
15:47:35.000000000 +0100
@@ -57,7 +57,7 @@ typedef struct fsig_plugin_ops {
 #define        disk_read_func (*fsig_disk_read_junk())
 #define        disk_read_hook (*fsig_disk_read_junk())
 #define        print_possibilities 0
-#define        noisy_printf
+#define        noisy_printf(fmt...)
 
 #define        grub_memset memset
 #define        grub_memmove memmove
--- 2011-12-12.orig/xen/arch/x86/debug.c        2011-12-12 15:46:14.000000000 
+0100
+++ 2011-12-12/xen/arch/x86/debug.c     2011-11-30 17:50:55.000000000 +0100
@@ -37,8 +37,8 @@
 #define DBGP1(...) {(kdbdbg>1) ? kdbp(__VA_ARGS__):0;}
 #define DBGP2(...) {(kdbdbg>2) ? kdbp(__VA_ARGS__):0;}
 #else
-#define DBGP1(...) {0;}
-#define DBGP2(...) {0;}
+#define DBGP1(...) ((void)0)
+#define DBGP2(...) ((void)0)
 #endif
 
 /* Returns: mfn for the given (hvm guest) vaddr */
--- 2011-12-12.orig/xen/arch/x86/hvm/svm/vpmu.c 2011-12-12 15:46:14.000000000 
+0100
+++ 2011-12-12/xen/arch/x86/hvm/svm/vpmu.c      2011-12-01 11:35:58.000000000 
+0100
@@ -154,7 +154,7 @@ static int amd_vpmu_do_interrupt(struct 
     if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) == APIC_MODE_FIXED )
         vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);
     else
-        test_and_set_bool(v->nmi_pending);
+        v->nmi_pending = 1;
 
     return 1;
 }
--- 2011-12-12.orig/xen/arch/x86/hvm/vmx/vpmu_core2.c   2011-12-12 
15:46:14.000000000 +0100
+++ 2011-12-12/xen/arch/x86/hvm/vmx/vpmu_core2.c        2011-12-01 
11:36:37.000000000 +0100
@@ -574,7 +574,7 @@ static int core2_vpmu_do_interrupt(struc
     if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) == APIC_MODE_FIXED )
         vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);
     else
-        test_and_set_bool(v->nmi_pending);
+        v->nmi_pending = 1;
     return 1;
 }
 
--- 2011-12-12.orig/xen/arch/x86/oprofile/nmi_int.c     2011-12-12 
15:46:14.000000000 +0100
+++ 2011-12-12/xen/arch/x86/oprofile/nmi_int.c  2011-11-30 18:01:11.000000000 
+0100
@@ -92,7 +92,7 @@ static int nmi_callback(struct cpu_user_
                send_guest_vcpu_virq(current, VIRQ_XENOPROF);
 
        if ( ovf == 2 ) 
-                test_and_set_bool(current->nmi_pending);
+                current->nmi_pending = 1;
        return 1;
 }
  
--- 2011-12-12.orig/xen/include/asm-x86/debugger.h      2011-12-12 
15:46:14.000000000 +0100
+++ 2011-12-12/xen/include/asm-x86/debugger.h   2011-11-30 17:58:20.000000000 
+0100
@@ -55,7 +55,12 @@ static inline int debugger_trap_fatal(
 
 #else
 
-#define debugger_trap_fatal(v, r) (0)
+static inline int debugger_trap_fatal(
+    unsigned int vector, struct cpu_user_regs *regs)
+{
+    return 0;
+}
+
 #define debugger_trap_immediate() ((void)0)
 
 #endif
--- 2011-12-12.orig/xen/include/asm-x86/hvm/hvm.h       2011-12-12 
15:46:14.000000000 +0100
+++ 2011-12-12/xen/include/asm-x86/hvm/hvm.h    2011-12-01 12:15:02.000000000 
+0100
@@ -235,7 +235,7 @@ int hvm_girq_dest_2_vcpu_id(struct domai
 #define hvm_long_mode_enabled(v) \
     ((v)->arch.hvm_vcpu.guest_efer & EFER_LMA)
 #else
-#define hvm_long_mode_enabled(v) (v,0)
+#define hvm_long_mode_enabled(v) ((void)(v),0)
 #endif
 
 enum hvm_intblk
--- 2011-12-12.orig/xen/include/xen/tmem_xen.h  2011-12-12 15:46:14.000000000 
+0100
+++ 2011-12-12/xen/include/xen/tmem_xen.h       2011-11-30 17:55:22.000000000 
+0100
@@ -365,7 +365,7 @@ static inline int tmh_page_cmp(pfp_t *pf
     // FIXME: code in assembly?
 ASSERT(p1 != NULL);
 ASSERT(p2 != NULL);
-    for ( i = PAGE_SIZE/sizeof(uint64_t); i && *p1 == *p2; i--, *p1++, *p2++ );
+    for ( i = PAGE_SIZE/sizeof(uint64_t); i && *p1 == *p2; i--, p1++, p2++ );
     if ( !i )
         return 0;
     if ( *p1 < *p2 )
@@ -386,7 +386,7 @@ static inline int tmh_pcd_cmp(void *va1,
     if ( len1 > len2 )
         return 1;
     ASSERT(len1 == len2);
-    for ( i = len2; i && *p1 == *p2; i--, *p1++, *p2++ );
+    for ( i = len2; i && *p1 == *p2; i--, p1++, p2++ );
     if ( !i )
         return 0;
     if ( *p1 < *p2 )
@@ -413,7 +413,7 @@ static inline int tmh_tze_pfp_cmp(pfp_t 
     if ( pfp_len > tze_len )
         return 1;
     ASSERT(pfp_len == tze_len);
-    for ( i = tze_len/sizeof(uint64_t); i && *p1 == *p2; i--, *p1++, *p2++ );
+    for ( i = tze_len/sizeof(uint64_t); i && *p1 == *p2; i--, p1++, p2++ );
     if ( !i )
         return 0;
     if ( *p1 < *p2 )
--- 2011-12-12.orig/xen/include/xsm/xsm.h       2011-12-12 15:46:14.000000000 
+0100
+++ 2011-12-12/xen/include/xsm/xsm.h    2011-12-12 15:23:49.000000000 +0100
@@ -163,7 +163,7 @@ extern struct xsm_operations *xsm_ops;
 static inline void xsm_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
-    xsm_call(security_domaininfo(d, info));
+    (void)xsm_call(security_domaininfo(d, info));
 }
 
 static inline int xsm_setvcpucontext(struct domain *d)
@@ -310,7 +310,7 @@ static inline int xsm_evtchn_interdomain
 
 static inline void xsm_evtchn_close_post (struct evtchn *chn)
 {
-    xsm_call(evtchn_close_post(chn));
+    (void)xsm_call(evtchn_close_post(chn));
 }
 
 static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
@@ -366,7 +366,7 @@ static inline int xsm_alloc_security_dom
 
 static inline void xsm_free_security_domain (struct domain *d)
 {
-    xsm_call(free_security_domain(d));
+    (void)xsm_call(free_security_domain(d));
 }
 
 static inline int xsm_alloc_security_evtchn (struct evtchn *chn)
@@ -376,7 +376,7 @@ static inline int xsm_alloc_security_evt
 
 static inline void xsm_free_security_evtchn (struct evtchn *chn)
 {
-    xsm_call(free_security_evtchn(chn));
+    (void)xsm_call(free_security_evtchn(chn));
 }
 
 static inline int xsm_memory_adjust_reservation (struct domain *d1, struct


Attachment: no-Wno-unused-value.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

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