From 6b68c26824affd2c22556ab6e8ff4df58785d7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 27 Jan 2019 17:13:42 +0100 Subject: [PATCH] test-util: drop _packed_ attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc-9 warns: ../src/test/test-util.c:147:19: note: in expansion of macro ‘container_of’ 147 | assert_se(container_of(&myval.v1, struct mytype, v1) == &myval); | ^~~~~~~~~~~~ I don't think packing matters here for the test of container_of(), so let's just remove it. --- src/test/test-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/test-util.c b/src/test/test-util.c index 3c1b5f9b41..40c1f4a3aa 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -139,11 +139,11 @@ static void test_container_of(void) { uint64_t v1; uint8_t pad2[2]; uint32_t v2; - } _packed_ myval = { }; + } myval = { }; log_info("/* %s */", __func__); - assert_cc(sizeof(myval) == 17); + assert_cc(sizeof(myval) >= 17); assert_se(container_of(&myval.v1, struct mytype, v1) == &myval); assert_se(container_of(&myval.v2, struct mytype, v2) == &myval); assert_se(container_of(&container_of(&myval.v2,