From: Zbigniew Jędrzejewski-Szmek Date: Sun, 27 Jan 2019 16:13:42 +0000 (+0100) Subject: test-util: drop _packed_ attribute X-Git-Tag: v241~22^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b68c26824affd2c22556ab6e8ff4df58785d7ad;p=thirdparty%2Fsystemd.git test-util: drop _packed_ attribute 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. --- diff --git a/src/test/test-util.c b/src/test/test-util.c index 3c1b5f9b413..40c1f4a3aa2 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,