All of lore.kernel.org
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Paul Durrant" <paul@xen.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-arm@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Anthony Perard" <anthony.perard@citrix.com>,
	xen-devel@lists.xenproject.org, philmd@redhat.com
Subject: [PATCH v3 11/13] compiler: remove GNUC check
Date: Thu, 10 Dec 2020 17:47:50 +0400	[thread overview]
Message-ID: <20201210134752.780923-12-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20201210134752.780923-1-marcandre.lureau@redhat.com>

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 6212295e52..5e6cf2c8e8 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -64,14 +64,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
 
 #define typeof_field(type, field) typeof(((type *)0)->field)
 #define type_check(t1,t2) ((t1*)0 - (t2*)0)
@@ -102,7 +98,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)
@@ -112,8 +108,6 @@
  */
 #  define __printf__ __gnu_printf__
 # endif
-#else
-#define GCC_FMT_ATTR(n, m)
 #endif
 
 #ifndef __has_warning
-- 
2.29.0



WARNING: multiple messages have this Message-ID (diff)
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: philmd@redhat.com,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Paul Durrant" <paul@xen.org>,
	xen-devel@lists.xenproject.org,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Anthony Perard" <anthony.perard@citrix.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-arm@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PATCH v3 11/13] compiler: remove GNUC check
Date: Thu, 10 Dec 2020 17:47:50 +0400	[thread overview]
Message-ID: <20201210134752.780923-12-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20201210134752.780923-1-marcandre.lureau@redhat.com>

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 6212295e52..5e6cf2c8e8 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -64,14 +64,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
 
 #define typeof_field(type, field) typeof(((type *)0)->field)
 #define type_check(t1,t2) ((t1*)0 - (t2*)0)
@@ -102,7 +98,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)
@@ -112,8 +108,6 @@
  */
 #  define __printf__ __gnu_printf__
 # endif
-#else
-#define GCC_FMT_ATTR(n, m)
 #endif
 
 #ifndef __has_warning
-- 
2.29.0



  parent reply	other threads:[~2020-12-10 14:15 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 13:47 [PATCH v3 00/13] Remove GCC < 4.8 checks marcandre.lureau
2020-12-10 13:47 ` marcandre.lureau
2020-12-10 13:47 ` [PATCH v3 01/13] qemu/atomic: Drop special case for unsupported compiler marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-14 16:56   ` Stefan Hajnoczi
2020-12-14 16:56     ` Stefan Hajnoczi
2020-12-10 13:47 ` [PATCH v3 02/13] accel/tcg: Remove special case for GCC < 4.6 marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-10 13:47 ` [PATCH v3 03/13] compiler.h: remove GCC < 3 __builtin_expect fallback marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-10 14:32   ` Philippe Mathieu-Daudé
2020-12-10 14:32     ` Philippe Mathieu-Daudé
2020-12-10 14:46     ` Peter Maydell
2020-12-10 14:46       ` Peter Maydell
2020-12-10 14:55       ` Marc-André Lureau
2020-12-10 14:55         ` Marc-André Lureau
2020-12-14 10:17     ` Paolo Bonzini
2020-12-10 13:47 ` [PATCH v3 04/13] qemu-plugin.h: remove GCC < 4 marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-10 13:47 ` [PATCH v3 05/13] tests: remove GCC < 4 fallbacks marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-10 13:47 ` [PATCH v3 06/13] virtiofsd: replace _Static_assert with QEMU_BUILD_BUG_ON marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-11 20:11   ` Dr. David Alan Gilbert
2020-12-11 20:11     ` Dr. David Alan Gilbert
2020-12-14 16:57   ` Stefan Hajnoczi
2020-12-14 16:57     ` Stefan Hajnoczi
2020-12-10 13:47 ` [PATCH v3 07/13] compiler.h: explicit case for Clang printf attribute marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-11  4:20   ` Michael Tokarev
2020-12-10 13:47 ` [PATCH v3 08/13] audio: remove GNUC & MSVC check marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-10 14:26   ` Philippe Mathieu-Daudé
2020-12-10 14:26     ` Philippe Mathieu-Daudé
2020-12-10 14:27     ` Peter Maydell
2020-12-10 14:27       ` Peter Maydell
2020-12-10 14:34       ` Philippe Mathieu-Daudé
2020-12-10 14:34         ` Philippe Mathieu-Daudé
2020-12-10 14:56         ` Marc-André Lureau
2020-12-10 14:56           ` Marc-André Lureau
2020-12-10 13:47 ` [PATCH v3 09/13] poison: remove GNUC check marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-10 14:27   ` Philippe Mathieu-Daudé
2020-12-10 14:27     ` Philippe Mathieu-Daudé
2020-12-10 13:47 ` [PATCH v3 10/13] xen: " marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-10 13:47 ` marcandre.lureau [this message]
2020-12-10 13:47   ` [PATCH v3 11/13] compiler: " marcandre.lureau
2020-12-12 13:53   ` Marc-André Lureau
2020-12-12 13:53     ` Marc-André Lureau
2020-12-12 14:00   ` Peter Maydell
2020-12-12 14:00     ` Peter Maydell
2020-12-10 13:47 ` [PATCH v3 12/13] linux-user: " marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-10 14:27   ` Philippe Mathieu-Daudé
2020-12-10 14:27     ` Philippe Mathieu-Daudé
2020-12-10 13:47 ` [PATCH v3 13/13] compiler.h: remove QEMU_GNUC_PREREQ marcandre.lureau
2020-12-10 13:47   ` marcandre.lureau
2020-12-14  8:05   ` Marc-André Lureau
2020-12-14  8:05     ` Marc-André Lureau
2020-12-10 13:57 ` [PATCH v3 00/13] Remove GCC < 4.8 checks no-reply
2020-12-10 13:57   ` no-reply
2020-12-14 10:20 ` Paolo Bonzini

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=20201210134752.780923-12-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=anthony.perard@citrix.com \
    --cc=dgilbert@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sstabellini@kernel.org \
    --cc=stefanha@redhat.com \
    --cc=xen-devel@lists.xenproject.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 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.