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

[Xen-devel] Re: xen-unstable xenctrl_osdep_ENOSYS.c does not compile with debug off



On Fri, 2011-01-14 at 08:08 +0000, John Weekes wrote:
> Ian, at least with my gcc, compiling with debug disabled currently
> fails here.

So it does. The error is pretty obvious, I've no idea why the compiler
didn't pickup on it with debugging turned on. Fix is:

8<---------------------

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1294994513 0
# Node ID 61eca858c1e0d5b54e701dcc3ee264605b1668f9
# Parent  5b3ae66d1a77038cf2d97d67bc8223afe8ea41ed
libxc: build fix with debugging disabled.

Currently hypercalls have only 5 arguments, hypercall->arg[0..4]. Do
not try and print arg[5] else:

        cc1: warnings being treated as errors
        xenctrl_osdep_ENOSYS.c: In function 'ENOSYS_privcmd_hypercall':
        xenctrl_osdep_ENOSYS.c:30: error: array subscript is above array bounds

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 5b3ae66d1a77 -r 61eca858c1e0 tools/libxc/xenctrl_osdep_ENOSYS.c
--- a/tools/libxc/xenctrl_osdep_ENOSYS.c        Fri Jan 14 08:28:32 2011 +0000
+++ b/tools/libxc/xenctrl_osdep_ENOSYS.c        Fri Jan 14 08:41:53 2011 +0000
@@ -27,10 +27,10 @@ static int ENOSYS_privcmd_close(xc_inter
 
 static int ENOSYS_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, 
privcmd_hypercall_t *hypercall)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: hypercall: 
%02lld(%#llx,%#llx,%#llx,%#llx,%#llx,%#llx)\n",
+    IPRINTF(xch, "ENOSYS_privcmd %p: hypercall: 
%02lld(%#llx,%#llx,%#llx,%#llx,%#llx)\n",
             h, hypercall->op,
             hypercall->arg[0], hypercall->arg[1], hypercall->arg[2],
-            hypercall->arg[3], hypercall->arg[4], hypercall->arg[5]);
+            hypercall->arg[3], hypercall->arg[4]);
     return -ENOSYS;
 }
 



_______________________________________________
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®.