qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH v2 12/13] compiler: remove GNUC check
Date: Thu, 26 Nov 2020 16:12:56 +0400	[thread overview]
Message-ID: <CAMxuvaymUu7n4RHFSPOf5rie57QsyBLzx=QSwxeeyfs2kSsWrw@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA_g5-tuqrRY8khKC0e7LBrJYr6DTVBx322=+yPYP4HcJQ@mail.gmail.com>

On Thu, Nov 26, 2020 at 4:10 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Thu, 26 Nov 2020 at 11:30, <marcandre.lureau@redhat.com> wrote:
> >
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > QEMU requires Clang or GCC, that define and support __GNUC__ extensions.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  include/qemu/compiler.h | 8 +-------
> >  1 file changed, 1 insertion(+), 7 deletions(-)
> >
> > diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> > index 108bfdb391..f492baf341 100644
> > --- a/include/qemu/compiler.h
> > +++ b/include/qemu/compiler.h
> > @@ -55,14 +55,10 @@
> >      (offsetof(container, field) + sizeof_field(container, field))
> >
> >  /* Convert from a base type to a parent type, with compile time checking.  */
> > -#ifdef __GNUC__
> >  #define DO_UPCAST(type, field, dev) ( __extension__ ( { \
> >      char __attribute__((unused)) offset_must_be_zero[ \
> >          -offsetof(type, field)]; \
> >      container_of(dev, type, field);}))
> > -#else
> > -#define DO_UPCAST(type, field, dev) container_of(dev, type, field)
> > -#endif
>
> This bit looks good.
>
> >  #define typeof_field(type, field) typeof(((type *)0)->field)
> >  #define type_check(t1,t2) ((t1*)0 - (t2*)0)
> > @@ -93,7 +89,7 @@
> >  #if defined(__clang__)
> >    /* clang doesn't support gnu_printf, so use printf. */
> >  # define GCC_FMT_ATTR(n, m) __attribute__((format(printf, n, m)))
> > -#elif defined(__GNUC__)
> > +#else
> >     /* Use gnu_printf (qemu uses standard format strings). */
> >  # define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m)))
> >  # if defined(_WIN32)
> > @@ -101,8 +97,6 @@
> >      * even when MinGW or GLib include files use __printf__. */
> >  #  define __printf__ __gnu_printf__
> >  # endif
> > -#else
> > -#define GCC_FMT_ATTR(n, m)
> >  #endif
>
> Didn't you already change the GCC_FMT_ATTR stuff in a previous
> patch in the series? If so this part should just be squashed
> into that one.
>

It's a mix of concerns. I focused on the first patch on the clang
exception, then dropped the explicit GNUC check. I would rather keep
it that way.

thanks



  reply	other threads:[~2020-11-26 12:18 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 11:29 [PATCH v2 00/13] Remove GCC < 4.8 checks marcandre.lureau
2020-11-26 11:29 ` [PATCH v2 01/13] compiler.h: replace QEMU_GNUC_PREREQ macro marcandre.lureau
2020-11-26 11:48   ` Peter Maydell
2020-11-26 11:55     ` Marc-André Lureau
2020-11-26 11:29 ` [PATCH v2 02/13] qemu/atomic: Drop special case for unsupported compiler marcandre.lureau
2020-11-26 11:49   ` Peter Maydell
2020-11-26 12:06     ` Daniel P. Berrangé
2020-11-26 12:13       ` Peter Maydell
2020-12-10 13:17         ` Marc-André Lureau
2020-12-10 13:42           ` Daniel P. Berrangé
2020-12-10 13:50             ` Daniel P. Berrangé
2020-11-26 11:29 ` [PATCH v2 03/13] accel/tcg: Remove special case for GCC < 4.6 marcandre.lureau
2020-11-26 11:29 ` [PATCH v2 04/13] compiler.h: remove GCC < 3 __builtin_expect fallback marcandre.lureau
2020-11-26 11:55   ` Peter Maydell
2020-12-10 13:35     ` Marc-André Lureau
2020-11-26 11:29 ` [PATCH v2 05/13] qemu-plugin.h: remove GCC < 4 marcandre.lureau
2020-11-26 11:57   ` Peter Maydell
2020-11-26 12:12     ` Daniel P. Berrangé
2020-11-26 12:14       ` Peter Maydell
2020-11-26 13:13         ` Alex Bennée
2020-11-26 11:29 ` [PATCH v2 06/13] tests: remove GCC < 4 fallbacks marcandre.lureau
2020-11-26 11:58   ` Peter Maydell
2020-11-27 13:10     ` Alex Bennée
2020-11-26 11:29 ` [PATCH v2 07/13] virtiofsd: replace _Static_assert with QEMU_BUILD_BUG_ON marcandre.lureau
2020-11-26 11:29 ` [PATCH v2 08/13] compiler.h: explicit case for Clang printf attribute marcandre.lureau
2020-11-26 12:00   ` Peter Maydell
2020-11-26 11:29 ` [PATCH v2 09/13] audio: remove GNUC & MSVC check marcandre.lureau
2020-11-26 12:06   ` Peter Maydell
2020-11-26 12:09     ` Marc-André Lureau
2020-11-27  7:15     ` Gerd Hoffmann
2020-11-27  7:20       ` Marc-André Lureau
2020-11-26 11:29 ` [PATCH v2 10/13] poison: remove GNUC check marcandre.lureau
2020-11-26 12:06   ` Peter Maydell
2020-11-26 11:29 ` [PATCH v2 11/13] xen: " marcandre.lureau
2020-11-26 12:09   ` Peter Maydell
2020-12-01 21:53     ` Stefano Stabellini
2020-11-26 11:29 ` [PATCH v2 12/13] compiler: " marcandre.lureau
2020-11-26 12:10   ` Peter Maydell
2020-11-26 12:12     ` Marc-André Lureau [this message]
2020-11-26 11:29 ` [PATCH v2 13/13] linux-user: " marcandre.lureau
2020-11-26 12:10   ` Peter Maydell
2020-11-26 11:57 ` [PATCH v2 00/13] Remove GCC < 4.8 checks no-reply

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='CAMxuvaymUu7n4RHFSPOf5rie57QsyBLzx=QSwxeeyfs2kSsWrw@mail.gmail.com' \
    --to=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.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).