From: Andrew Cooper <andrew.cooper3@citrix.com>
To: M A Young <m.a.young@durham.ac.uk>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Compile errors with gcc 4.8
Date: Thu, 7 Feb 2013 00:55:13 +0000 [thread overview]
Message-ID: <5112FB71.3050600@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1302062013370.12408@procyon.dur.ac.uk>
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.
~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
next prev parent reply other threads:[~2013-02-07 0:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 20:37 Compile errors with gcc 4.8 M A Young
2013-02-07 0:55 ` Andrew Cooper [this message]
2013-02-07 8:59 ` M A Young
2013-02-07 9:06 ` Ian Campbell
2013-02-07 9:57 ` Jan Beulich
2013-02-07 11:55 ` Keir Fraser
2013-02-07 23:20 ` [PATCH 1/2] " M A Young
2013-02-08 8:11 ` Jan Beulich
2013-02-08 20:56 ` [PATCH 1/2 v2] " M A Young
2013-02-07 9:07 ` M A Young
2013-02-07 9:08 ` Frediano Ziglio
2013-02-07 10:02 ` Jan Beulich
2013-02-07 23:25 ` [Patch 2/2] " M A Young
2013-02-08 8:13 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5112FB71.3050600@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=m.a.young@durham.ac.uk \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).