From: Ian Jackson Subject: Re: Xen 4.1.0 RC2 released Date: Wed, 26 Jan 2011 15:00:29 +0000 Message-ID: <19776.14093.541075.242524@mariner.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: M A Young Cc: xen-devel@lists.xensource.com, Keir Fraser , Stabellini , Stefano List-Id: xen-devel@lists.xenproject.org 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 Signed-off-by: Ian Jackson 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; }