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 errorslib/sys.c: In function 'open_savefile':lib/sys.c:186:5: error: passing argument 1 of 'snprintf' from incompatible pointer type /home/michael/rpmbuild/BUILD/xen-4.1.0/stubdom/cross-root-x86_64/x86_64-xen-elf/include/stdio.h:264:5: note: expected 'char *' but argument is of type 'char **' lib/sys.c:188:5: error: passing argument 1 of 'init_consfront' from incompatible pointer type /home/michael/rpmbuild/BUILD/xen-4.1.0/stubdom/../extras/mini-os/include/mini-os/console.h:82:23: note: expected 'char *' but argument is of type 'char **' lib/sys.c: In function 'open':lib/sys.c:213:9: error: passing argument 1 of 'open_savefile' discards qualifiers from pointer target typelib/sys.c:181:5: note: expected 'char *' but argument is of type 'const char *'lib/sys.c: In function 'write':lib/sys.c:289:25: error: pointer of type 'void *' used in arithmetic
make[2]: *** [/home/michael/rpmbuild/BUILD/xen-4.1.0/stubdom/mini-os-x86_64-ioemu/lib/sys.o] Error 1
make[2]: Leaving directory `/home/michael/rpmbuild/BUILD/xen-4.1.0/extras/mini-os'
make[1]: *** [ioemu-stubdom] Error 2
M A Young writes ("[Xen-devel] Re: Xen 4.1.0 RC2 released"):
Quoted 5 lines
I get the following failure building
xen-4.1.0/stubdom/mini-os-x86_64-ioemu/lib/sys.occ1: 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.
extras/mini-os/lib/sys.c +3 -3
@@ -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; }
Quoted 9 lines · Ian Jackson
M A Young writes ("[Xen-devel] Re: Xen 4.1.0 RC2 released"):
Quoted 5 lines
I get the following failure building
xen-4.1.0/stubdom/mini-os-x86_64-ioemu/lib/sys.occ1: 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 ?
Yes it works.
Michael Young