[xen] add some fixes for code which gcc 4.8 complains about

myoung myoung at fedoraproject.org
Tue Feb 5 20:33:32 UTC 2013


commit 70d4a6ab62cb58ff1d959fa781877257c7703bed
Author: Michael Young <m.a.young at durham.ac.uk>
Date:   Tue Feb 5 20:13:39 2013 +0000

    add some fixes for code which gcc 4.8 complains about

 gcc48.build.patch |   75 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 xen.spec          |    3 ++
 2 files changed, 78 insertions(+), 0 deletions(-)
---
diff --git a/gcc48.build.patch b/gcc48.build.patch
new file mode 100644
index 0000000..5a0e35b
--- /dev/null
+++ b/gcc48.build.patch
@@ -0,0 +1,75 @@
+--- xen-4.2.1/tools/libxc/xc_dom_boot.c.orig	2012-12-17 15:00:48.000000000 +0000
++++ xen-4.2.1/tools/libxc/xc_dom_boot.c	2013-01-28 22:21:13.215782329 +0000
+@@ -266,7 +266,7 @@
+         return rc;
+ 
+     /* let the vm run */
+-    memset(ctxt, 0, sizeof(ctxt));
++    memset(ctxt, 0, sizeof(*ctxt));
+     if ( (rc = dom->arch_hooks->vcpu(dom, ctxt)) != 0 )
+         return rc;
+     xc_dom_unmap_all(dom);
+--- xen-4.2.1/tools/blktap2/drivers/md5.c.orig	2012-12-17 15:00:11.000000000 +0000
++++ xen-4.2.1/tools/blktap2/drivers/md5.c	2013-01-28 23:49:51.940289123 +0000
+@@ -174,7 +174,7 @@
+     MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+     byteReverse((unsigned char *) ctx->buf, 4);
+     memcpy(digest, ctx->buf, 16);
+-    memset(ctx, 0, sizeof(ctx));     /* In case it's sensitive */
++    memset(ctx, 0, sizeof(*ctx));     /* In case it's sensitive */
+ }
+ 
+ /* The four core functions - F1 is optimized somewhat */
+--- xen-4.2.1/tools/libxl/libxl_qmp.c.orig	2012-12-17 15:01:09.000000000 +0000
++++ xen-4.2.1/tools/libxl/libxl_qmp.c	2013-01-29 21:28:27.763650073 +0000
+@@ -377,7 +377,7 @@
+     ret = libxl_fd_set_cloexec(qmp->ctx, qmp->qmp_fd, 1);
+     if (ret) return -1;
+ 
+-    memset(&qmp->addr, 0, sizeof (&qmp->addr));
++    memset(&qmp->addr, 0, sizeof (qmp->addr));
+     qmp->addr.sun_family = AF_UNIX;
+     strncpy(qmp->addr.sun_path, qmp_socket_path,
+             sizeof (qmp->addr.sun_path));
+--- xen-4.2.1/tools/xenstat/libxenstat/src/xenstat_linux.c.orig	2012-12-17 15:01:35.000000000 +0000
++++ xen-4.2.1/tools/xenstat/libxenstat/src/xenstat_linux.c	2013-01-29 21:43:46.044169987 +0000
+@@ -113,7 +113,7 @@
+ 
+ 	/* Initialize all variables called has passed as non-NULL to zeros */
+ 	if (iface != NULL)
+-		memset(iface, 0, sizeof(iface));
++		memset(iface, 0, sizeof(*iface));
+ 	if (rxBytes != NULL)
+ 		*rxBytes = 0;
+ 	if (rxPackets != NULL)
+--- xen-4.2.1/tools/debugger/kdd/kdd-xen.c.orig	2012-12-17 15:00:22.000000000 +0000
++++ xen-4.2.1/tools/debugger/kdd/kdd-xen.c	2013-01-29 21:45:12.652087239 +0000
+@@ -333,7 +333,7 @@
+     if (!cpu) 
+         return -1;
+ 
+-    memset(r, 0, sizeof(r));
++    memset(r, 0, sizeof(*r));
+     
+     if (w64)
+         kdd_get_regs_x86_64(cpu, &r->r64);
+--- xen-4.2.1/tools/python/xen/lowlevel/netlink/libnetlink.c.orig	2012-12-17 15:01:24.000000000 +0000
++++ xen-4.2.1/tools/python/xen/lowlevel/netlink/libnetlink.c	2013-01-29 21:47:59.524001053 +0000
+@@ -37,7 +37,7 @@
+        int sndbuf = 32768;
+        int rcvbuf = 32768;
+ 
+-       memset(rth, 0, sizeof(rth));
++       memset(rth, 0, sizeof(*rth));
+ 
+        rth->fd = socket(AF_NETLINK, SOCK_RAW, protocol);
+        if (rth->fd < 0) {
+@@ -264,7 +264,7 @@
+                return -1;
+        }
+ 
+-       memset(buf,0,sizeof(buf));
++       memset(buf,0,sizeof(*buf));
+ 
+        iov.iov_base = buf;
+ 
diff --git a/xen.spec b/xen.spec
index 973d19e..097142f 100644
--- a/xen.spec
+++ b/xen.spec
@@ -83,6 +83,7 @@ Patch61: xsa37-4.2.patch
 Patch62: man.formatting.patch
 Patch63: xsa41.patch
 Patch64: xsa38.patch
+Patch65: gcc48.build.patch
 
 Patch100: xen-configure-xend.patch
 
@@ -256,6 +257,7 @@ manage Xen virtual machines.
 %patch62 -p1
 %patch63 -p1
 %patch64 -p1
+%patch65 -p1
 
 %patch100 -p1
 
@@ -750,6 +752,7 @@ rm -rf %{buildroot}
   CVE-2013-0215] (#907888)
 - guest using AMD-Vi for PCI passthrough can cause denial of service
   [XSA-36, CVE-2013-0153]
+- add some fixes for code which gcc 4.8 complains about
 
 * Wed Jan 23 2013 Michael Young <m.a.young at durham.ac.uk>
 - correct disabling of xendomains.service on uninstall


More information about the scm-commits mailing list