All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	xen-devel@lists.xenproject.org,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Anthony PERARD" <anthony@xenproject.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: [PATCH 2/2] qom/object: Remove pre-C11 check
Date: Sat, 13 Jun 2026 19:51:51 +0200	[thread overview]
Message-ID: <20260613175151.1357-3-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20260613175151.1357-1-philmd@oss.qualcomm.com>

We mandate a compiler supporting C11 since 2021-06-15 in
commit d22797ce36a ("configure: Use -std=gnu11"), thus the
max_align_t type definition exists. Remove what is now dead
code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 qom/object.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index 0ac201de4c1..f79b2cf3618 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -675,18 +675,6 @@ static void object_finalize(void *data)
     }
 }
 
-/* Find the minimum alignment guaranteed by the system malloc. */
-#if __STDC_VERSION__ >= 201112L
-typedef max_align_t qemu_max_align_t;
-#else
-typedef union {
-    long l;
-    void *p;
-    double d;
-    long double ld;
-} qemu_max_align_t;
-#endif
-
 static Object *object_new_with_type(Type type)
 {
     Object *obj;
@@ -703,7 +691,7 @@ static Object *object_new_with_type(Type type)
      * Do not use qemu_memalign unless required.  Depending on the
      * implementation, extra alignment implies extra overhead.
      */
-    if (likely(align <= __alignof__(qemu_max_align_t))) {
+    if (likely(align <= __alignof__(max_align_t))) {
         obj = g_malloc(size);
         obj_free = g_free;
     } else {
-- 
2.53.0



  parent reply	other threads:[~2026-06-13 17:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-13 17:51 [PATCH 0/2] misc: Remove pre-C99/C11 checks Philippe Mathieu-Daudé
2026-06-13 17:51 ` [PATCH 1/2] hw/xen/interface: Remove pre-C99 checks Philippe Mathieu-Daudé
2026-06-13 18:13   ` Bastian Blank
2026-06-14 16:40     ` Philippe Mathieu-Daudé
2026-06-13 17:51 ` Philippe Mathieu-Daudé [this message]
2026-06-15  5:05   ` [PATCH 2/2] qom/object: Remove pre-C11 check Markus Armbruster

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=20260613175151.1357-3-philmd@oss.qualcomm.com \
    --to=philmd@oss.qualcomm.com \
    --cc=anthony@xenproject.org \
    --cc=berrange@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --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.