]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic: Move assertion specific functions to assert-util.h
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 12 Apr 2025 12:14:04 +0000 (14:14 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 18 Apr 2025 11:59:06 +0000 (13:59 +0200)
Various functions in log.h are only used by asserts, and there's
enough assertion related stuff in macro.h to justify a separate header
which also makes it easier to avoid circular dependencies.

Let's introduce assert-util.h and an accompanying fundamental header
and move all the assertion related stuff over there. PROJECT_FILE is
moved over to macro.h.

27 files changed:
src/basic/alloc-util.h
src/basic/argv-util.h
src/basic/assert-util.c [new file with mode: 0644]
src/basic/assert-util.h [new file with mode: 0644]
src/basic/dlfcn-util.h
src/basic/errno-util.h
src/basic/log.c
src/basic/log.h
src/basic/macro.h
src/basic/meson.build
src/basic/signal-util.h
src/basic/stdio-util.h
src/boot/bcd.c
src/fundamental/assert-fundamental.h [new file with mode: 0644]
src/fundamental/iovec-util-fundamental.h
src/fundamental/macro-fundamental.h
src/fundamental/memory-util-fundamental.h
src/fundamental/sha256-fundamental.c
src/fundamental/string-util-fundamental.h
src/fuzz/fuzz.h
src/shared/fstab-util.h
src/shared/osc-context.h
src/shared/pretty-print.h
src/sysupdate/sysupdate-update-set-flags.c
src/test/test-dlopen.c
src/test/test-sizeof.c
src/udev/udevadm-hwdb.c

index e589a94fd093d06ee0463d9a6044b10a10e33284..8bb3c42113032fceca93b3eadd5b2102dc21ac4a 100644 (file)
@@ -7,6 +7,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "assert-util.h"
 #include "macro.h"
 
 #if HAS_FEATURE_MEMORY_SANITIZER
index a20a951793a1d31d68a5709969918a6aa94bdfe4..deaa7c04e63c5cbf1fe80e3abc36b4ebf794e5f3 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <stdbool.h>
 
+#include "assert-util.h"
 #include "macro.h"
 
 extern int saved_argc;
diff --git a/src/basic/assert-util.c b/src/basic/assert-util.c
new file mode 100644 (file)
index 0000000..f4cf97a
--- /dev/null
@@ -0,0 +1,65 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+#include <stdio.h>
+
+#include "assert-util.h"
+#include "errno-util.h"
+#include "log.h"
+
+static bool assert_return_is_critical = BUILD_MODE_DEVELOPER;
+
+/* Akin to glibc's __abort_msg; which is private and we hence cannot
+ * use here. */
+static char *log_abort_msg = NULL;
+
+void log_set_assert_return_is_critical(bool b) {
+        assert_return_is_critical = b;
+}
+
+bool log_get_assert_return_is_critical(void) {
+        return assert_return_is_critical;
+}
+
+static void log_assert(
+        int level,
+        const char *text,
+        const char *file,
+        int line,
+        const char *func,
+        const char *format) {
+
+        static char buffer[LINE_MAX];
+
+        if (_likely_(LOG_PRI(level) > log_get_max_level()))
+                return;
+
+        DISABLE_WARNING_FORMAT_NONLITERAL;
+        (void) snprintf(buffer, sizeof buffer, format, text, file, line, func);
+        REENABLE_WARNING;
+
+        log_abort_msg = buffer;
+
+        log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
+}
+
+_noreturn_ void log_assert_failed(const char *text, const char *file, int line, const char *func) {
+        log_assert(LOG_CRIT, text, file, line, func,
+                   "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
+        abort();
+}
+
+_noreturn_ void log_assert_failed_unreachable(const char *file, int line, const char *func) {
+        log_assert(LOG_CRIT, "Code should not be reached", file, line, func,
+                   "%s at %s:%u, function %s(). Aborting. ðŸ’¥");
+        abort();
+}
+
+void log_assert_failed_return(const char *text, const char *file, int line, const char *func) {
+
+        if (assert_return_is_critical)
+                log_assert_failed(text, file, line, func);
+
+        PROTECT_ERRNO;
+        log_assert(LOG_DEBUG, text, file, line, func,
+                   "Assertion '%s' failed at %s:%u, function %s(), ignoring.");
+}
diff --git a/src/basic/assert-util.h b/src/basic/assert-util.h
new file mode 100644 (file)
index 0000000..9383a6b
--- /dev/null
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "assert-fundamental.h"
+#include "macro.h"
+
+/* Logging for various assertions */
+
+void log_set_assert_return_is_critical(bool b);
+bool log_get_assert_return_is_critical(void) _pure_;
+
+_noreturn_ void log_assert_failed(const char *text, const char *file, int line, const char *func);
+_noreturn_ void log_assert_failed_unreachable(const char *file, int line, const char *func);
+void log_assert_failed_return(const char *text, const char *file, int line, const char *func);
+
+#ifdef __COVERITY__
+
+/* Use special definitions of assertion macros in order to prevent
+ * false positives of ASSERT_SIDE_EFFECT on Coverity static analyzer
+ * for uses of assert_se() and assert_return().
+ *
+ * These definitions make expression go through a (trivial) function
+ * call to ensure they are not discarded. Also use ! or !! to ensure
+ * the boolean expressions are seen as such.
+ *
+ * This technique has been described and recommended in:
+ * https://community.synopsys.com/s/question/0D534000046Yuzb/suppressing-assertsideeffect-for-functions-that-allow-for-sideeffects
+ */
+
+extern void __coverity_panic__(void);
+
+static inline void __coverity_check__(int condition) {
+        if (!condition)
+                __coverity_panic__();
+}
+
+static inline int __coverity_check_and_return__(int condition) {
+        return condition;
+}
+
+#define assert_message_se(expr, message) __coverity_check__(!!(expr))
+
+#define assert_log(expr, message) __coverity_check_and_return__(!!(expr))
+
+#else  /* ! __COVERITY__ */
+
+#define assert_message_se(expr, message)                                \
+        do {                                                            \
+                if (_unlikely_(!(expr)))                                \
+                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
+        } while (false)
+
+#define assert_log(expr, message) ((_likely_(expr))                     \
+        ? (true)                                                        \
+        : (log_assert_failed_return(message, PROJECT_FILE, __LINE__, __func__), false))
+
+#endif  /* __COVERITY__ */
+
+#define assert_se(expr) assert_message_se(expr, #expr)
+
+/* We override the glibc assert() here. */
+#undef assert
+#ifdef NDEBUG
+#define assert(expr) ({ if (!(expr)) __builtin_unreachable(); })
+#else
+#define assert(expr) assert_message_se(expr, #expr)
+#endif
+
+#define assert_not_reached()                                            \
+        log_assert_failed_unreachable(PROJECT_FILE, __LINE__, __func__)
+
+#define assert_return(expr, r)                                          \
+        do {                                                            \
+                if (!assert_log(expr, #expr))                           \
+                        return (r);                                     \
+        } while (false)
+
+#define assert_return_errno(expr, r, err)                               \
+        do {                                                            \
+                if (!assert_log(expr, #expr)) {                         \
+                        errno = err;                                    \
+                        return (r);                                     \
+                }                                                       \
+        } while (false)
index 17c084ae73332759399a2fc3d52e4bea4b0fb64d..e92e00b1e8732ce87a846b43ce24fc90357f2c4f 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <dlfcn.h>
 
+#include "assert-util.h"
 #include "macro.h"
 
 static inline void* safe_dlclose(void *dl) {
index 02572e3bdcdf9a90614ebff392f9a70568147d1b..01b4d59e04540c0e62ec38f54a86f3dc1d4222d9 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "assert-util.h"
 #include "macro.h"
 
 /* strerror(3) says that glibc uses a maximum length of 1024 bytes. */
index 0c50cde0b4178856927198e1a5923b431d3110a7..3d2346f686994fa8cabb5622b1cd8e9bb8eaf4dd 100644 (file)
@@ -78,11 +78,6 @@ static bool upgrade_syslog_to_journal = false;
 static bool always_reopen_console = false;
 static bool open_when_needed = false;
 static bool prohibit_ipc = false;
-static bool assert_return_is_critical = BUILD_MODE_DEVELOPER;
-
-/* Akin to glibc's __abort_msg; which is private and we hence cannot
- * use here. */
-static char *log_abort_msg = NULL;
 
 static thread_local const char *log_prefix = NULL;
 
@@ -950,61 +945,6 @@ int log_object_internal(
         return r;
 }
 
-static void log_assert(
-                int level,
-                const char *text,
-                const char *file,
-                int line,
-                const char *func,
-                const char *format) {
-
-        static char buffer[LINE_MAX];
-
-        if (_likely_(LOG_PRI(level) > log_max_level))
-                return;
-
-        DISABLE_WARNING_FORMAT_NONLITERAL;
-        (void) snprintf(buffer, sizeof buffer, format, text, file, line, func);
-        REENABLE_WARNING;
-
-        log_abort_msg = buffer;
-
-        log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
-}
-
-_noreturn_ void log_assert_failed(
-                const char *text,
-                const char *file,
-                int line,
-                const char *func) {
-        log_assert(LOG_CRIT, text, file, line, func,
-                   "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
-        abort();
-}
-
-_noreturn_ void log_assert_failed_unreachable(
-                const char *file,
-                int line,
-                const char *func) {
-        log_assert(LOG_CRIT, "Code should not be reached", file, line, func,
-                   "%s at %s:%u, function %s(). Aborting. ðŸ’¥");
-        abort();
-}
-
-void log_assert_failed_return(
-                const char *text,
-                const char *file,
-                int line,
-                const char *func) {
-
-        if (assert_return_is_critical)
-                log_assert_failed(text, file, line, func);
-
-        PROTECT_ERRNO;
-        log_assert(LOG_DEBUG, text, file, line, func,
-                   "Assertion '%s' failed at %s:%u, function %s(), ignoring.");
-}
-
 int log_oom_internal(int level, const char *file, int line, const char *func) {
         return log_internal(level, ENOMEM, file, line, func, "Out of memory.");
 }
@@ -1318,14 +1258,6 @@ static int log_set_ratelimit_kmsg_from_string(const char *e) {
         return 0;
 }
 
-void log_set_assert_return_is_critical(bool b) {
-        assert_return_is_critical = b;
-}
-
-bool log_get_assert_return_is_critical(void) {
-        return assert_return_is_critical;
-}
-
 static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
 
         /*
index 34d2a5eb296fa9bde80334883bf4c8c3cb6a1102..9759b28dc035529b853464d60f6da135663c8984 100644 (file)
@@ -79,9 +79,6 @@ int log_show_tid_from_string(const char *e);
  * environment should not be called from library code â€” this is always a job
  * for the application itself. */
 
-assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1);
-#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
-
 bool stderr_is_journal(void);
 int log_open(void);
 void log_close(void);
@@ -185,24 +182,6 @@ int log_dump_internal(
                 const char *func,
                 char *buffer);
 
-/* Logging for various assertions */
-_noreturn_ void log_assert_failed(
-                const char *text,
-                const char *file,
-                int line,
-                const char *func);
-
-_noreturn_ void log_assert_failed_unreachable(
-                const char *file,
-                int line,
-                const char *func);
-
-void log_assert_failed_return(
-                const char *text,
-                const char *file,
-                int line,
-                const char *func);
-
 #define log_dispatch(level, error, buffer)                              \
         log_dispatch_internal(level, error, PROJECT_FILE, __LINE__, __func__, NULL, NULL, NULL, NULL, buffer)
 
@@ -336,9 +315,6 @@ void log_set_open_when_needed(bool b);
  * stderr, the console or kmsg */
 void log_set_prohibit_ipc(bool b);
 
-void log_set_assert_return_is_critical(bool b);
-bool log_get_assert_return_is_critical(void) _pure_;
-
 int log_dup_console(void);
 
 int log_syntax_internal(
index 2b3c02c32425272ced2d4db413eb81885df10466..b1599633da56046ae864f902a0d428f441412c4a 100644 (file)
@@ -42,6 +42,9 @@
 #error "neither int nor long are four bytes long?!?"
 #endif
 
+assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1);
+#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
+
 static inline uint64_t u64_multiply_safe(uint64_t a, uint64_t b) {
         if (_unlikely_(a != 0 && b > (UINT64_MAX / a)))
                 return 0; /* overflow */
@@ -103,76 +106,6 @@ static inline size_t GREEDY_ALLOC_ROUND_UP(size_t l) {
                 (type*)( (char *)UNIQ_T(A, uniq) - offsetof(type, member) ); \
         })
 
-#ifdef __COVERITY__
-
-/* Use special definitions of assertion macros in order to prevent
- * false positives of ASSERT_SIDE_EFFECT on Coverity static analyzer
- * for uses of assert_se() and assert_return().
- *
- * These definitions make expression go through a (trivial) function
- * call to ensure they are not discarded. Also use ! or !! to ensure
- * the boolean expressions are seen as such.
- *
- * This technique has been described and recommended in:
- * https://community.synopsys.com/s/question/0D534000046Yuzb/suppressing-assertsideeffect-for-functions-that-allow-for-sideeffects
- */
-
-extern void __coverity_panic__(void);
-
-static inline void __coverity_check__(int condition) {
-        if (!condition)
-                __coverity_panic__();
-}
-
-static inline int __coverity_check_and_return__(int condition) {
-        return condition;
-}
-
-#define assert_message_se(expr, message) __coverity_check__(!!(expr))
-
-#define assert_log(expr, message) __coverity_check_and_return__(!!(expr))
-
-#else  /* ! __COVERITY__ */
-
-#define assert_message_se(expr, message)                                \
-        do {                                                            \
-                if (_unlikely_(!(expr)))                                \
-                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
-        } while (false)
-
-#define assert_log(expr, message) ((_likely_(expr))                     \
-        ? (true)                                                        \
-        : (log_assert_failed_return(message, PROJECT_FILE, __LINE__, __func__), false))
-
-#endif  /* __COVERITY__ */
-
-#define assert_se(expr) assert_message_se(expr, #expr)
-
-/* We override the glibc assert() here. */
-#undef assert
-#ifdef NDEBUG
-#define assert(expr) ({ if (!(expr)) __builtin_unreachable(); })
-#else
-#define assert(expr) assert_message_se(expr, #expr)
-#endif
-
-#define assert_not_reached()                                            \
-        log_assert_failed_unreachable(PROJECT_FILE, __LINE__, __func__)
-
-#define assert_return(expr, r)                                          \
-        do {                                                            \
-                if (!assert_log(expr, #expr))                           \
-                        return (r);                                     \
-        } while (false)
-
-#define assert_return_errno(expr, r, err)                               \
-        do {                                                            \
-                if (!assert_log(expr, #expr)) {                         \
-                        errno = err;                                    \
-                        return (r);                                     \
-                }                                                       \
-        } while (false)
-
 #define return_with_errno(r, err)                     \
         do {                                          \
                 errno = abs(err);                     \
index c3ca1537b519e292d62b1b139e672fcada7eade1..9db77a95a647e24a1ce7c297141375e09663eeb7 100644 (file)
@@ -7,6 +7,7 @@ basic_sources = files(
         'architecture.c',
         'argv-util.c',
         'arphrd-util.c',
+        'assert-util.c',
         'audit-util.c',
         'btrfs.c',
         'build.c',
index dc2b9de14797926b89cdd5e9a1fe0d607de3f3dd..d64d50312435cf62aa4c8fb82673ba393d75d229 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <signal.h>
 
+#include "assert-util.h"
 #include "macro.h"
 
 int reset_all_signal_handlers(void);
index 0a2239d02259e65cf494a5f8dc0d70bed0b83f25..bd5871821c46c77cd9b925f530d7e07bfdbed42f 100644 (file)
@@ -6,6 +6,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 
+#include "assert-util.h"
 #include "macro.h"
 
 _printf_(3, 4)
index 4533d479c1470bffbdaeb4a0a986b93c5b322f34..9b5596b23aa2a51c4253737c243abf2119e57a8a 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <stdalign.h>
 
+#include "assert-fundamental.h"
 #include "bcd.h"
 #include "efi-string.h"
 
diff --git a/src/fundamental/assert-fundamental.h b/src/fundamental/assert-fundamental.h
new file mode 100644 (file)
index 0000000..292656a
--- /dev/null
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#if !SD_BOOT
+#  include <assert.h>
+#endif
+
+#include "macro-fundamental.h"
+
+#if SD_BOOT
+        _noreturn_ void efi_assert(const char *expr, const char *file, unsigned line, const char *function);
+
+        #ifdef NDEBUG
+                #define assert(expr) ({ if (!(expr)) __builtin_unreachable(); })
+                #define assert_not_reached() __builtin_unreachable()
+        #else
+                #define assert(expr) ({ _likely_(expr) ? VOID_0 : efi_assert(#expr, __FILE__, __LINE__, __func__); })
+                #define assert_not_reached() efi_assert("Code should not be reached", __FILE__, __LINE__, __func__)
+        #endif
+        #define assert_se(expr) ({ _likely_(expr) ? VOID_0 : efi_assert(#expr, __FILE__, __LINE__, __func__); })
+#endif
+
+/* This passes the argument through after (if asserts are enabled) checking that it is not null. */
+#define ASSERT_PTR(expr) _ASSERT_PTR(expr, UNIQ_T(_expr_, UNIQ), assert)
+#define ASSERT_SE_PTR(expr) _ASSERT_PTR(expr, UNIQ_T(_expr_, UNIQ), assert_se)
+#define _ASSERT_PTR(expr, var, check)      \
+        ({                                 \
+                typeof(expr) var = (expr); \
+                check(var);                \
+                var;                       \
+        })
+
+#define ASSERT_NONNEG(expr)                              \
+        ({                                               \
+                typeof(expr) _expr_ = (expr), _zero = 0; \
+                assert(_expr_ >= _zero);                 \
+                _expr_;                                  \
+        })
+
+#define ASSERT_SE_NONNEG(expr)                           \
+        ({                                               \
+                typeof(expr) _expr_ = (expr), _zero = 0; \
+                assert_se(_expr_ >= _zero);              \
+                _expr_;                                  \
+        })
index edd95fa4e9a4ef8e0a054c40da456e1cda3148e8..4214afea9a20a547b9bea559bc57ac36f2277994 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include "assert-fundamental.h"
+
 #if SD_BOOT
 /* struct iovec is a POSIX userspace construct. Let's introduce it also in EFI mode, it's just so useful */
 struct iovec {
index ac18326a43a301b33d7f26d866550d0f11d03c77..585bacaf821f31d2035647c0d5bd184dd0e3c943 100644 (file)
 #define CONCATENATE(x, y) XCONCATENATE(x, y)
 
 #if SD_BOOT
-        _noreturn_ void efi_assert(const char *expr, const char *file, unsigned line, const char *function);
-
-        #ifdef NDEBUG
-                #define assert(expr) ({ if (!(expr)) __builtin_unreachable(); })
-                #define assert_not_reached() __builtin_unreachable()
-        #else
-                #define assert(expr) ({ _likely_(expr) ? VOID_0 : efi_assert(#expr, __FILE__, __LINE__, __func__); })
-                #define assert_not_reached() efi_assert("Code should not be reached", __FILE__, __LINE__, __func__)
-        #endif
         #define static_assert _Static_assert
-        #define assert_se(expr) ({ _likely_(expr) ? VOID_0 : efi_assert(#expr, __FILE__, __LINE__, __func__); })
 #endif
 
-/* This passes the argument through after (if asserts are enabled) checking that it is not null. */
-#define ASSERT_PTR(expr) _ASSERT_PTR(expr, UNIQ_T(_expr_, UNIQ), assert)
-#define ASSERT_SE_PTR(expr) _ASSERT_PTR(expr, UNIQ_T(_expr_, UNIQ), assert_se)
-#define _ASSERT_PTR(expr, var, check)      \
-        ({                                 \
-                typeof(expr) var = (expr); \
-                check(var);                \
-                var;                       \
-        })
-
-#define ASSERT_NONNEG(expr)                              \
-        ({                                               \
-                typeof(expr) _expr_ = (expr), _zero = 0; \
-                assert(_expr_ >= _zero);                 \
-                _expr_;                                  \
-        })
-
-#define ASSERT_SE_NONNEG(expr)                           \
-        ({                                               \
-                typeof(expr) _expr_ = (expr), _zero = 0; \
-                assert_se(_expr_ >= _zero);              \
-                _expr_;                                  \
-        })
-
 #define assert_cc(expr) static_assert(expr, #expr)
 
 #define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
index f42d54f97a29d0452e4d595859032e930c1473fb..4b50714f5e14c73941ddfb19042bacc1d9f0635f 100644 (file)
@@ -9,6 +9,7 @@
 #  include <string.h>
 #endif
 
+#include "assert-fundamental.h"
 #include "macro-fundamental.h"
 
 #define memzero(x, l)                                           \
index 03381835d6c9cf5de9976acafcf84aa5f392e512..9f8b0106fe63da7ba7ededffd6af6803904fa349 100644 (file)
@@ -21,6 +21,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include "assert-fundamental.h"
 #include "macro-fundamental.h"
 #include "memory-util-fundamental.h"
 #include "sha256-fundamental.h"
index ec3ad48706a0e04cece397f49ef8718016292d99..a9638b4d0e6559780c47ce2bbfd11b7fc194b110 100644 (file)
@@ -8,6 +8,7 @@
 #  include <string.h>
 #endif
 
+#include "assert-fundamental.h"
 #include "macro-fundamental.h"
 
 #if SD_BOOT
index 123e88e8e938ee1aab3a3e6fd7e4e91cb91e03ed..6961fce7c1ac859010d98d542c48c1b232ff27ba 100644 (file)
@@ -4,6 +4,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include "assert-util.h"
 #include "env-util.h"
 #include "fileio.h"
 
index 3fc1440e197cd5f331549739f47a101aee90e5b8..8dd42700257ebf88f4814f3c0d82af1b9fc7f9f6 100644 (file)
@@ -4,6 +4,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 
+#include "assert-util.h"
 #include "macro.h"
 
 bool fstab_enabled_full(int enabled);
index 20c70b718317dcd205777a74a075b8517d2b174a..6c9882c8944919314ae8319d806c68f94292c977 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "sd-id128.h"
 
+#include "assert-util.h"
 #include "macro.h"
 
 int osc_context_open_boot(char **ret_seq);
index fbfccb0a2e544b85b25b976c04ab8172d7efe0e3..16966c3ab8c9f9a97fee4099e86689757533e5c1 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include "ansi-color.h"
+#include "assert-util.h"
 #include "glyph-util.h"
 #include "terminal-util.h"
 
index e12c34a436288bf727dc2af36165caa1a735f528..ffed02d1f10966993e7915e21e5ce8746993d73f 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include "ansi-color.h"
+#include "assert-util.h"
 #include "glyph-util.h"
 #include "sysupdate-update-set-flags.h"
 #include "terminal-util.h"
index 6704e936e7b95fa5b7acf21975da7b22deccff06..fd5bc32d5bf6b6e6bfe108ea38b05f7e61cb8031 100644 (file)
@@ -3,6 +3,7 @@
 #include <dlfcn.h>
 #include <stdlib.h>
 
+#include "assert-util.h"
 #include "macro.h"
 
 int main(int argc, char **argv) {
index ea0c58770ec25ac7fa350486ce14fc3e09b3e8ec..4e87f4ab740b8aeaf6f9f514ee3733dc5d38fae9 100644 (file)
@@ -11,6 +11,7 @@
 #define __STDC_WANT_IEC_60559_TYPES_EXT__
 #include <float.h>
 
+#include "assert-util.h"
 #include "time-util.h"
 
 /* Print information about various types. Useful when diagnosing
index f306a4ffd6d82975d078be0c5eb010f0f69c923c..f4c3072b2e66dee0383ce2e8082080d5b3f2d453 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <getopt.h>
 
+#include "assert-util.h"
 #include "hwdb-util.h"
 #include "udevadm.h"