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] [PATCH] gcc4isms part 2

To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] gcc4isms part 2
From: Rik van Riel <riel@xxxxxxxxxx>
Date: Fri, 4 Mar 2005 17:22:46 -0500 (EST)
Delivery-date: Fri, 04 Mar 2005 22:28:27 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
This completes the gcc4ism changes to the Xen tree.  All of
the changes in this patch are in the tools/ subdirectory and
are pretty simple.  Some of the changes are for overly strict
gcc4 warnings, but I guess it's still good to verify that the
variable really wasn't unused, or that the sign change is
really harmless.

I guess I really do like -Werror now...

Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>

 libxc/xc_linux_build.c      |    2 +-
 libxc/xc_plan9_build.c      |   24 ++++++++++++------------
 libxc/xc_vmx_build.c        |    2 +-
 python/xen/lowlevel/xu/xu.c |    2 +-
 xcs/xcs.c                   |    2 +-
 xfrd/lzi_stream.c           |    2 +-
 xfrd/marshal.c              |    4 ++--
 xfrd/xdr.c                  |    2 +-
 xfrd/xfrd.c                 |   12 ++++++------
 9 files changed, 26 insertions(+), 26 deletions(-)

--- xen-unstable/tools/libxc/xc_linux_build.c.gcc4      2005-03-04 
13:12:51.000000000 -0500
+++ xen-unstable/tools/libxc/xc_linux_build.c   2005-03-04 13:15:28.000000000 
-0500
@@ -279,7 +279,7 @@
         start_info->mod_start    = vinitrd_start;
         start_info->mod_len      = initrd_len;
     }
-    strncpy(start_info->cmd_line, cmdline, MAX_CMDLINE);
+    strncpy((char *)start_info->cmd_line, cmdline, MAX_CMDLINE);
     start_info->cmd_line[MAX_CMDLINE-1] = '\0';
     munmap(start_info, PAGE_SIZE);
 
--- xen-unstable/tools/libxc/xc_plan9_build.c.plan9     2005-03-04 
13:30:06.000000000 -0500
+++ xen-unstable/tools/libxc/xc_plan9_build.c   2005-03-04 13:32:59.000000000 
-0500
@@ -81,14 +81,14 @@
 plan9header(Exec * header)
 {
        /* header is big-endian */
-       swabby(&header->magic, "magic");
-       swabby(&header->text, "text");
-       swabby(&header->data, "data");
-       swabby(&header->bss, "bss");
-       swabby(&header->syms, "syms");
-       swabby(&header->entry, "entry");
-       swabby(&header->spsz, "spsz");
-       swabby(&header->pcsz, "pcsz");
+       swabby((unsigned long *)&header->magic, "magic");
+       swabby((unsigned long *)&header->text, "text");
+       swabby((unsigned long *)&header->data, "data");
+       swabby((unsigned long *)&header->bss, "bss");
+       swabby((unsigned long *)&header->syms, "syms");
+       swabby((unsigned long *)&header->entry, "entry");
+       swabby((unsigned long *)&header->spsz, "spsz");
+       swabby((unsigned long *)&header->pcsz, "pcsz");
 
 }
 
@@ -131,8 +131,8 @@
        unsigned long ksize;
        mmu_t *mmu = NULL;
        int i;
-       unsigned long first_page_after_kernel, 
-         first_data_page, 
+       unsigned long first_page_after_kernel = 0, 
+         first_data_page = 0, 
          page_array_page;
        unsigned long cpu0pdb, cpu0pte, cpu0ptelast;
        unsigned long /*last_pfn, */ tot_pte_pages;
@@ -357,7 +357,7 @@
        start_info->flags = 0;
        DPRINTF((" control event channel is %d\n", control_evtchn));
        start_info->domain_controller_evtchn = control_evtchn;
-       strncpy(start_info->cmd_line, cmdline, MAX_CMDLINE);
+       strncpy((char *)start_info->cmd_line, cmdline, MAX_CMDLINE);
        start_info->cmd_line[MAX_CMDLINE - 1] = '\0';
        munmap(start_info, PAGE_SIZE);
 
@@ -406,7 +406,7 @@
               unsigned int control_evtchn, unsigned long flags)
 {
        dom0_op_t launch_op, op;
-       unsigned long load_addr;
+       unsigned long load_addr = 0;
        long tot_pages;
        int kernel_fd = -1;
        gzFile kernel_gfd = NULL;
--- xen-unstable/tools/libxc/xc_vmx_build.c.gcc4        2005-03-04 
14:25:01.000000000 -0500
+++ xen-unstable/tools/libxc/xc_vmx_build.c     2005-03-04 14:25:12.000000000 
-0500
@@ -339,7 +339,7 @@
         page_array[(vboot_params_start-dsi.v_start)>>PAGE_SHIFT]);
     memset(boot_paramsp, 0, sizeof(*boot_paramsp));
 
-    strncpy(boot_paramsp->cmd_line, cmdline, 0x800);
+    strncpy((char *)boot_paramsp->cmd_line, cmdline, 0x800);
     boot_paramsp->cmd_line[0x800-1] = '\0';
     boot_paramsp->cmd_line_ptr = ((unsigned long) vboot_params_start) + 
offsetof(struct linux_boot_params, cmd_line);
 
--- xen-unstable/tools/python/xen/lowlevel/xu/xu.c.gcc4 2005-03-04 
14:42:25.000000000 -0500
+++ xen-unstable/tools/python/xen/lowlevel/xu/xu.c      2005-03-04 
14:43:44.000000000 -0500
@@ -773,7 +773,7 @@
         return dict;
     }
 
-    return PyString_FromStringAndSize(xum->msg.msg, xum->msg.length);
+    return PyString_FromStringAndSize((char *)xum->msg.msg, xum->msg.length);
 }
 
 static PyObject *xu_message_get_header(PyObject *self, PyObject *args)
--- xen-unstable/tools/xfrd/xfrd.c.gcc4 2005-03-04 15:00:14.000000000 -0500
+++ xen-unstable/tools/xfrd/xfrd.c      2005-03-04 15:10:18.000000000 -0500
@@ -481,9 +481,9 @@
         err = -EINVAL;
         goto exit;
     }
-    err = intof(sxpr_childN(sxpr, 0, ONONE), &hello_major);
+    err = intof(sxpr_childN(sxpr, 0, ONONE), (int *)&hello_major);
     if(err) goto exit;
-    err = intof(sxpr_childN(sxpr, 1, ONONE), &hello_minor);
+    err = intof(sxpr_childN(sxpr, 1, ONONE), (int *)&hello_minor);
     if(err) goto exit;
     if(hello_major != major || hello_minor != minor){
         eprintf("> Wanted protocol version %d.%d, got %d.%d",
@@ -646,7 +646,7 @@
         if(!err) err = errcode;
     } else if(sxpr_elementp(sxpr, oxfr_xfr_ok)){
         // Ok - get the new domain id.
-        err = intof(sxpr_childN(sxpr, 0, ONONE), &state->vmid_new);
+        err = intof(sxpr_childN(sxpr, 0, ONONE), (int *)&state->vmid_new);
         xfr_error(peer, err);
     } else {
         // Anything else is invalid. But it may be too late.
@@ -917,7 +917,7 @@
         int n = 0;
 
         dprintf("> xfr.migrate\n");
-        err = intof(sxpr_childN(sxpr, n++, ONONE), &state->vmid);
+        err = intof(sxpr_childN(sxpr, n++, ONONE), (int *)&state->vmid);
         if(err) goto exit;
         err = stringof(sxpr_childN(sxpr, n++, ONONE), &state->vmconfig);
         if(err) goto exit;
@@ -939,7 +939,7 @@
         int n = 0;
 
         dprintf("> xfr.save\n");
-        err = intof(sxpr_childN(sxpr, n++, ONONE), &state->vmid);
+        err = intof(sxpr_childN(sxpr, n++, ONONE), (int *)&state->vmid);
         if(err) goto exit;
         err = stringof(sxpr_childN(sxpr, n++, ONONE), &state->vmconfig);
         if(err) goto exit;
@@ -965,7 +965,7 @@
         int n = 0;
 
         dprintf("> xfr.xfr\n");
-        err = intof(sxpr_childN(sxpr, n++, ONONE), &state->vmid);
+        err = intof(sxpr_childN(sxpr, n++, ONONE), (int *)&state->vmid);
         if(err) goto exit;
         err = xfr_recv(args, state, conn);
 
--- xen-unstable/tools/xfrd/lzi_stream.c.gcc4   2005-03-04 16:18:17.000000000 
-0500
+++ xen-unstable/tools/xfrd/lzi_stream.c        2005-03-04 16:19:36.000000000 
-0500
@@ -242,7 +242,7 @@
     int err = 0, k = 0;
     //dprintf(">\n");
     if(s->eof) goto exit;
-    err = unmarshal_uint32(s->io, &k);
+    err = unmarshal_uint32(s->io, (unsigned int *)&k);
     if(err) goto exit;
     if(k > s->inbuf_size){
         err = -EINVAL;
--- xen-unstable/tools/xfrd/marshal.c.gcc4      2005-03-04 16:23:31.000000000 
-0500
+++ xen-unstable/tools/xfrd/marshal.c   2005-03-04 16:24:14.000000000 -0500
@@ -166,7 +166,7 @@
 int unmarshal_string(IOStream *io, char *s, uint32_t s_n){
     int err = 0, val_n = 0;
     //dprintf(">\n");
-    err = unmarshal_uint32(io, &val_n);
+    err = unmarshal_uint32(io, (unsigned int *)&val_n);
     if(err) goto exit;
     if(val_n >= s_n){
         err = -EINVAL;
@@ -184,7 +184,7 @@
     int err = 0, val_n = 0;
     char *val = NULL;
     //dprintf(">\n");
-    err = unmarshal_uint32(io, &val_n);
+    err = unmarshal_uint32(io, (unsigned int *)&val_n);
     if(err) goto exit;
     val = allocate(val_n + 1);
     if(!val){
--- xen-unstable/tools/xfrd/xdr.c.gcc4  2005-03-04 16:54:26.000000000 -0500
+++ xen-unstable/tools/xfrd/xdr.c       2005-03-04 16:55:10.000000000 -0500
@@ -283,7 +283,7 @@
         err = unpack_cons(io, &val);
         break;
     case T_BOOL:
-        err = unpack_bool(io, &u);
+        err = unpack_bool(io, (int *)&u);
         if(err) goto exit;
         val = (u ? OTRUE : OFALSE);
         break;
--- xen-unstable/tools/xcs/xcs.c.gcc4   2005-03-04 17:06:17.000000000 -0500
+++ xen-unstable/tools/xcs/xcs.c        2005-03-04 17:06:55.000000000 -0500
@@ -743,7 +743,7 @@
             int size;
             memset (&remote_addr, 0, sizeof (remote_addr));
             size = sizeof remote_addr;
-            ret = accept(listen_fd, (struct sockaddr *)&remote_addr, &size);
+            ret = accept(listen_fd, (struct sockaddr *)&remote_addr, 
(socklen_t *)&size);
             if ( ret < 0 )
             {
                 perror("accept()");


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

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