From: Stefan Weil <sw@weilnetz.de>
To: "Søren Sandmann" <sandmann@cs.au.dk>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Fix compilation on GCC 4.5
Date: Wed, 03 Oct 2012 20:19:36 +0200 [thread overview]
Message-ID: <506C81B8.908@weilnetz.de> (raw)
In-Reply-To: <1349287498-10475-1-git-send-email-sandmann@cs.au.dk>
Am 03.10.2012 20:04, schrieb Søren Sandmann:
> From: Søren Sandmann Pedersen<ssp@redhat.com>
>
> Apparently GCC 4.5 still warns about "value computed not used" even
> with __attribute__((unused)). Fix this by only doing the compile time
> check on gcc> 4.5.
>
> Signed-off-by: Soren Sandmann<ssp@redhat.com>
> ---
>
> I need this patch to get qemu to compile with GCC 4.5, but I'm not
> sure if 4.5 is the right compiler version to check against.
>
> osdep.h | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/osdep.h b/osdep.h
> index cb213e0..df89552 100644
> --- a/osdep.h
> +++ b/osdep.h
> @@ -41,8 +41,9 @@ typedef signed int int_fast16_t;
> #endif
>
> /* Convert from a base type to a parent type, with compile time checking. */
> -#ifdef __GNUC__
> -#define DO_UPCAST(type, field, dev) ( __extension__ ( { \
> +#if defined (__GNUC__)&& \
> + (__GNUC__> 4 || (__GNUC__ == 4&& __GNUC_MINOR__> 5))
> +#define DO_UPCAST(type, field, dev) ( __extension__ ( { \
> char __attribute__((unused)) offset_must_be_zero[ \
> -offsetof(type, field)]; \
> container_of(dev, type, field);}))
Hello,
I don't see any warnings with gcc Debian 4.4.5-8.
Could you please provide more information on your environment
and the warnings which you get?
Here is a macro which simplifies the version check:
#if QEMU_GNUC_PREREQ(4, 6)
Regards
Stefan Weil
next prev parent reply other threads:[~2012-10-03 18:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-03 18:04 [Qemu-devel] [PATCH] Fix compilation on GCC 4.5 Søren Sandmann
2012-10-03 18:19 ` Stefan Weil [this message]
2012-10-03 19:49 ` Søren Sandmann
2012-10-03 20:45 ` Stefan Weil
2012-10-04 5:44 ` Søren Sandmann
2012-10-03 20:55 ` Richard Henderson
2012-10-04 4:31 ` Søren Sandmann
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=506C81B8.908@weilnetz.de \
--to=sw@weilnetz.de \
--cc=qemu-devel@nongnu.org \
--cc=sandmann@cs.au.dk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.