From 7c226462e048e4b72a613ccb04c22f2aaf1dfd30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 20 Mar 2017 22:13:34 +0800 Subject: [PATCH] core: Mark meta_fatal() as not returning This also makes meta_fatal() not returning, even if a NULL format is passed. https://bugzilla.gnome.org/show_bug.cgi?id=780304 https://bugzilla.gnome.org/show_bug.cgi?id=777732 --- src/core/util.c | 4 +++- src/meta/util.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/util.c b/src/core/util.c index a3a799caa..d596ea4c9 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -470,7 +470,9 @@ meta_fatal (const char *format, ...) gchar *str; FILE *out; - g_return_if_fail (format != NULL); + g_warn_if_fail (format); + if (!format) + meta_exit (META_EXIT_ERROR); va_start (args, format); str = g_strdup_vprintf (format, args); diff --git a/src/meta/util.h b/src/meta/util.h index 8de831bf6..3619e8adb 100644 --- a/src/meta/util.h +++ b/src/meta/util.h @@ -43,7 +43,7 @@ void meta_bug (const char *format, void meta_warning (const char *format, ...) G_GNUC_PRINTF (1, 2); void meta_fatal (const char *format, - ...) G_GNUC_PRINTF (1, 2); + ...) G_GNUC_PRINTF (1, 2) G_GNUC_NORETURN G_ANALYZER_NORETURN; /** * MetaDebugTopic: