[mutter] core: Mark meta_fatal() as not returning



commit 7c226462e048e4b72a613ccb04c22f2aaf1dfd30
Author: Jonas Ådahl <jadahl gmail com>
Date:   Mon Mar 20 22:13:34 2017 +0800

    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 a3a799c..d596ea4 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 8de831b..3619e8a 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:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]