]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-util: drop _packed_ attribute
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 27 Jan 2019 16:13:42 +0000 (17:13 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 4 Feb 2019 19:32:44 +0000 (20:32 +0100)
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

index 3c1b5f9b413d964506ab6600e253e25c5ba40836..40c1f4a3aa207576ccc249e62998191d19eef0b6 100644 (file)
@@ -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,