From e93189469abfa6310edcbf70952d7fe0484e6207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 12 Jun 2026 15:05:33 +0200 Subject: [PATCH] qom/object: Remove pre-C11 check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Note, C11 provides aligned_alloc(). Using it is left as a future cleanup step. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster Reviewed-by: Richard Henderson Message-Id: <20260615091308.4458-3-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 0ac201de4c..f79b2cf361 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 {