summaryrefslogtreecommitdiff
path: root/src/shared/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/log.c')
-rw-r--r--src/shared/log.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/shared/log.c b/src/shared/log.c
index 3e48b3ccc2..8d1067c63b 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -703,22 +703,21 @@ int log_meta_object(
return r;
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
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;
snprintf(buffer, sizeof(buffer), format, text, file, line, func);
+ REENABLE_WARNING;
char_array_0(buffer);
log_abort_msg = buffer;
log_dispatch(level, file, line, func, NULL, NULL, buffer);
}
-#pragma GCC diagnostic pop
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.");