From 64dd77361f7ab97365d264408afb538097c0339c Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 16 Mar 2021 11:03:44 +0100 Subject: lib: rework how we "override" assert() The previous method, using zassert.h and hoping nothing includes assert.h (which, on glibc at least, just does "#undef assert" and puts its own definition in...) was fragile - and actually broke undetected. Just provide our own assert.h and control overriding by putting it in a separate directory to add to the include path (or not.) Signed-off-by: David Lamparter --- lib/log.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'lib/log.c') diff --git a/lib/log.c b/lib/log.c index ca2f501686..15fdfd4b0a 100644 --- a/lib/log.c +++ b/lib/log.c @@ -311,17 +311,6 @@ void zlog_thread_info(int log_level) zlog(log_level, "Current thread not known/applicable"); } -void _zlog_assert_failed(const char *assertion, const char *file, - unsigned int line, const char *function) -{ - zlog(LOG_CRIT, "Assertion `%s' failed in file %s, line %u, function %s", - assertion, file, line, (function ? function : "?")); - zlog_backtrace(LOG_CRIT); - zlog_thread_info(LOG_CRIT); - log_memstats(stderr, "log"); - abort(); -} - void memory_oom(size_t size, const char *name) { zlog(LOG_CRIT, -- cgit v1.2.3