From: Ian Campbell Subject: Re: xen-unstable xenctrl_osdep_ENOSYS.c does not compile with debug off Date: Fri, 14 Jan 2011 08:53:03 +0000 Message-ID: <1294995183.8240.79.camel@zakaz.uk.xensource.com> References: <4D300490.9080302@nuclearfallout.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4D300490.9080302@nuclearfallout.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: John Weekes Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org 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 # 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 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; }