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

[Xen-devel] Compile errors with gcc 4.8



Fedora rawhide has just moved onto gcc 4.8, and I have had to apply the attached patch to get it to build (I constructed the patch against 4.2.1 but I believe it will apply to xen-unstable).

There are two types of problem, the first is from xen/common/compat/memory.c where the error is

memory.c: In function 'compat_memory_op':
/builddir/build/BUILD/xen-4.2.1/xen/include/public/arch-x86/xen.h:35:33: error: typedef '__guest_handle_const_compat_memory_exchange_t' locally defined but not used [-Werror=unused-local-typedefs]
     typedef struct { type *p; } __guest_handle_ ## name
                                 ^
/builddir/build/BUILD/xen-4.2.1/xen/include/public/arch-x86/xen.h:43:5: note: in expansion of macro '___DEFINE_XEN_GUEST_HANDLE'
     ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
     ^
/builddir/build/BUILD/xen-4.2.1/xen/include/public/arch-x86/xen.h:44:41: note: in expansion of macro '__DEFINE_XEN_GUEST_HANDLE' #define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
                                         ^
memory.c:261:13: note: in expansion of macro 'DEFINE_XEN_GUEST_HANDLE'
             DEFINE_XEN_GUEST_HANDLE(compat_memory_exchange_t);
             ^

so we are defining something that isn't used.

Secondly gcc 4.8 objects to lines like

memset(ctxt, 0, sizeof(ctxt));

where I think you are just zeroing a pointer's worth of memory. There are a few cases of this in the xen code fixed in the patch, and I am also suspicious of line 630 of stubdom/grub-upstream/stage2/fsys_reiserfs.c which is

memset (INFO->blocks, 0, sizeof (INFO->blocks));

which is noted in the build log but not flagged as an error.

        Michael Young

Attachment: gcc48.build.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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