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

Re: [Xen-devel] Compile errors with gcc 4.8



On Thu, 2013-02-07 at 00:55 +0000, Andrew Cooper wrote:
> On 06/02/2013 20:37, M A Young wrote:
> > 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.
> 
> But it is used, by guest_handle_cast, albeit through several layers of
> macros.
> 
> I would tentativly object to the use of "__attribute__((unused));" to
> work around what appears to be a gcc bug.  If 4.8 support is desperately
> wanted, then a better solution would be to specify
> -Wno-unused-local-typedefs to disable the buggy feature.
> 

A workaround would be to put the defined outside the function. At the
end it's just a typedef.

> ~Andrew
> 
> >
> > 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
> 

This seems real problems even to me. The md5 code is know and wrong to
me for sure.

Frediano

_______________________________________________
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®.