WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: xen-unstable xenctrl_osdep_ENOSYS.c does not compile wit

To: John Weekes <lists.xen@xxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: xen-unstable xenctrl_osdep_ENOSYS.c does not compile with debug off
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Fri, 14 Jan 2011 08:53:03 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 14 Jan 2011 00:54:55 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D300490.9080302@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <4D300490.9080302@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>