summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-02-13 08:40:05 +0100
committerThomas Haller <thaller@redhat.com>2023-02-13 08:46:40 +0100
commita29eb970c89f12d118830d0ee46cdda2b6cd7f8b (patch)
tree2b57072c22113454ab6ea4cb17594fa57bb613bf
parent861fc6854cb6398458bbeea4e878dcc9a209564c (diff)
downloadNetworkManager-a29eb970c89f12d118830d0ee46cdda2b6cd7f8b.tar.gz
Revert "std-aux: drop assertion and function name from assert() in release mode"
glibc defines __assert_fail as: extern void __assert_fail (const char *__assertion, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); but musl as: _Noreturn void __assert_fail (const char *, const char *, int, const char *); (note the difference in the type for the line argument). This cannot be made to work, unless we would detect the used type at configure time, which seems too much effort. Drop this again. This reverts commit 1ce29e120bfc763441495bbf5620fa0751753c9c. Fixes: 1ce29e120bfc ('std-aux: drop assertion and function name from assert() in release mode')
-rw-r--r--src/libnm-std-aux/nm-std-aux.h19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h
index e556aa4b52..75703e70b4 100644
--- a/src/libnm-std-aux/nm-std-aux.h
+++ b/src/libnm-std-aux/nm-std-aux.h
@@ -219,25 +219,6 @@ typedef uint64_t _nm_bitwise nm_be64_t;
#define NM_MORE_ASSERTS 0
#endif
-#if NM_MORE_ASSERTS == 0
-/* The string with the assertion check and the function name blows up the
- * binary size. In production mode, let's drop those, similar to
- * g_assertion_message_expr.
- *
- * Note that <assert.h> can be included multiple times. We can thus
- * not redefine __assert_fail(...). Instead, just redefine the name
- * __assert_fail. */
-_nm_noreturn static inline void
-_nm_assert_fail_internal(const char *assertion,
- const char *file,
- unsigned int line,
- const char *function)
-{
- __assert_fail("<dropped>", file, line, "<unknown-fcn>");
-}
-#define __assert_fail _nm_assert_fail_internal
-#endif
-
#ifndef NDEBUG
#define _NM_ASSERT_FAIL_ENABLED 1
#define _nm_assert_fail(msg) __assert_fail((msg), __FILE__, __LINE__, __func__)