]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-macro: CONST_MAX() and friends may return (void*)0 when built under coverity
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 14 Mar 2025 21:48:37 +0000 (06:48 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 14 Mar 2025 23:56:38 +0000 (08:56 +0900)
See 963c6c90af87fdf8b7dcb942991fb018b87fea07.

src/test/test-macro.c

index c4c533777dc4a54c984d5fc334d68ac1bf045273..78422de9ee18a2b07c53d493fc4a1c10d23404d0 100644 (file)
@@ -80,7 +80,7 @@ TEST(MAX) {
         /* CONST_MAX returns (void) instead of a value if the passed arguments
          * are not of the same type or not constant expressions. */
         assert_cc(__builtin_types_compatible_p(typeof(CONST_MAX(1, 10)), int));
-        assert_cc(__builtin_types_compatible_p(typeof(CONST_MAX(1, 1U)), void));
+        assert_cc(__builtin_types_compatible_p(typeof(CONST_MAX(1, 1U)), typeof(VOID_0)));
 
         assert_se(val1.a == 100);
         assert_se(MAX(++d, 0) == 1);
@@ -618,8 +618,8 @@ TEST(ALIGN_TO) {
         assert_cc(CONST_ALIGN_TO(513, 512) == 1024);
         assert_cc(CONST_ALIGN_TO(sizeof(int), 64) == 64);
 
-        assert_cc(__builtin_types_compatible_p(typeof(CONST_ALIGN_TO(4, 3)), void));
-        assert_cc(__builtin_types_compatible_p(typeof(CONST_ALIGN_TO(SIZE_MAX, 512)), void));
+        assert_cc(__builtin_types_compatible_p(typeof(CONST_ALIGN_TO(4, 3)), typeof(VOID_0)));
+        assert_cc(__builtin_types_compatible_p(typeof(CONST_ALIGN_TO(SIZE_MAX, 512)), typeof(VOID_0)));
 }
 
 TEST(align_down) {