[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: Xen 4.1.0 RC2 released



M A Young writes ("[Xen-devel] Re: Xen 4.1.0 RC2 released"):
> I get the following failure building 
> xen-4.1.0/stubdom/mini-os-x86_64-ioemu/lib/sys.o
> 
> cc1: warnings being treated as errors
> lib/sys.c: In function 'open_savefile':

These do seem to be genuine bugs.  I don't know why our compiler
doesn't warn or fail on this.  Can you try this patch ?


stubdom, minios: correct mistakes in types causing compilation failures

open_savefile ignores its path argument so it can be const char *.
The buffer is nodename is a buffer of characters.
Arithmetic on void*'s is not permitted.

Reported-by: M A Young <m.a.young@xxxxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

diff -r 67d5b8004947 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c  Wed Jan 26 11:58:45 2011 +0000
+++ b/extras/mini-os/lib/sys.c  Wed Jan 26 14:58:53 2011 +0000
@@ -178,10 +178,10 @@ int posix_openpt(int flags)
     return(dev->fd);
 }
 
-int open_savefile(char *path, int save)
+int open_savefile(const char *path, int save)
 {
     struct consfront_dev *dev;
-    char *nodename[64];
+    char nodename[64];
 
     snprintf(nodename, sizeof(nodename), "device/console/%d", save ? 
SAVE_CONSOLE : RESTORE_CONSOLE);
 
@@ -286,7 +286,7 @@ int write(int fd, const void *buf, size_
                 while (nbytes > 0) {
                     ret = xencons_ring_send(files[fd].cons.dev, (char *)buf, 
nbytes);
                     nbytes -= ret;
-                    buf += ret;
+                    buf = (char*)buf + ret;
                 }
                 return tot - nbytes;
             }

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.