@samitouri / QOSamiQemu / commits / e93189469a

qom/object: Remove pre-C11 check

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é <philmd@oss.qualcomm.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20260615091308.4458-3-philmd@oss.qualcomm.com>

Philippe Mathieu-Daudé committed Jun 12, 2026 at 15:05 UTC e93189469abfa6310edcbf70952d7fe0484e6207
1 file changed +1 -13
qom/object.c
+1 -13
@@ -675,18 +675,6 @@ static void object_finalize(void *data)
675 }
676 }
677
678 -/* Find the minimum alignment guaranteed by the system malloc. */
679 -#if __STDC_VERSION__ >= 201112L
680 -typedef max_align_t qemu_max_align_t;
681 -#else
682 -typedef union {
683 - long l;
684 - void *p;
685 - double d;
686 - long double ld;
687 -} qemu_max_align_t;
688 -#endif
689 -
678 static Object *object_new_with_type(Type type)
679 {
680 Object *obj;
@@ -703,7 +691,7 @@ static Object *object_new_with_type(Type type)
691 * Do not use qemu_memalign unless required. Depending on the
692 * implementation, extra alignment implies extra overhead.
693 */
706 - if (likely(align <= __alignof__(qemu_max_align_t))) {
694 + if (likely(align <= __alignof__(max_align_t))) {
695 obj = g_malloc(size);
696 obj_free = g_free;
697 } else {