All of lore.kernel.org
 help / color / mirror / Atom feed
* xen-unstable xenctrl_osdep_ENOSYS.c does not compile with debug off
@ 2011-01-14  8:08 John Weekes
  2011-01-14  8:53 ` Ian Campbell
  0 siblings, 1 reply; 2+ messages in thread
From: John Weekes @ 2011-01-14  8:08 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel@lists.xensource.com


[-- Attachment #1.1: Type: text/plain, Size: 2679 bytes --]

Ian, at least with my gcc, compiling with debug disabled currently fails 
here. Compiling with debug enabled (the default) seems to work properly.

xen-unstable.hg # make tools
...
gcc  -DPIC -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 
-Wall -Wstrict-prototypes -Wno-unused-value 
-Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -MF 
.xenctrl_osdep_ENOSYS.opic.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 
-D_GNU_SOURCE -I../../xen/common/libelf -Werror -Wmissing-prototypes  
-I. -I../xenstore -I../include -fPIC -c -o xenctrl_osdep_ENOSYS.opic 
xenctrl_osdep_ENOSYS.c
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
make[4]: *** [xenctrl_osdep_ENOSYS.opic] Error 1
make[4]: Leaving directory `/usr/src/xen-unstable.hg/tools/libxc'
make[3]: *** [build] Error 2
make[3]: Leaving directory `/usr/src/xen-unstable.hg/tools/libxc'
make[2]: *** [subdir-install-libxc] Error 2
make[2]: Leaving directory `/usr/src/xen-unstable.hg/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/usr/src/xen-unstable.hg/tools'
make: *** [install-tools] Error 2

xen-unstable.hg # gcc -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: 
/var/tmp/portage/sys-devel/gcc-4.4.4-r2/work/gcc-4.4.4/configure 
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4 
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/include 
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.4 
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.4/man 
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.4/info 
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/include/g++-v4 
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec 
--disable-fixed-point --without-ppl --without-cloog --enable-nls 
--without-included-gettext --with-system-zlib --disable-werror 
--enable-secureplt --enable-multilib --enable-libmudflap 
--disable-libssp --enable-libgomp 
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.4.4/python 
--enable-checking=release --disable-libgcj 
--enable-languages=c,c++,fortran --enable-shared --enable-threads=posix 
--enable-__cxa_atexit --enable-clocale=gnu 
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.4.4-r2 
p1.2, pie-0.4.5'
Thread model: posix
gcc version 4.4.4 (Gentoo 4.4.4-r2 p1.2, pie-0.4.5)

I backed out 97779ffa76f5 
<http://xenbits.xensource.com/staging/xen-unstable.hg?rev/97779ffa76f5> 
and 81987b3eac08 
<http://xenbits.xensource.com/staging/xen-unstable.hg?rev/81987b3eac08> 
and tools compile again w/o debug.

-John

[-- Attachment #1.2: Type: text/html, Size: 3334 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: xen-unstable xenctrl_osdep_ENOSYS.c does not compile with debug off
  2011-01-14  8:08 xen-unstable xenctrl_osdep_ENOSYS.c does not compile with debug off John Weekes
@ 2011-01-14  8:53 ` Ian Campbell
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2011-01-14  8:53 UTC (permalink / raw)
  To: John Weekes; +Cc: xen-devel@lists.xensource.com

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@citrix.com>
# 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@citrix.com>

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;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-14  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-14  8:08 xen-unstable xenctrl_osdep_ENOSYS.c does not compile with debug off John Weekes
2011-01-14  8:53 ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.