[gjs/wip/ptomato/mozjs31prep: 4/15] build: Suppress jsapi.h warnings in Clang



commit 273a8fda67591720c53788ce2a7af2d5f7a37dff
Author: Philip Chimento <philip chimento gmail com>
Date:   Sun Sep 18 11:50:58 2016 -0700

    build: Suppress jsapi.h warnings in Clang
    
    It requires slightly different macros to suppress the warnings from
    jsapi.h in Clang.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742249

 gjs/compat.h |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gjs/compat.h b/gjs/compat.h
index 236ce60..76f5b5a 100644
--- a/gjs/compat.h
+++ b/gjs/compat.h
@@ -29,14 +29,20 @@
 #ifndef __GJS_COMPAT_H__
 #define __GJS_COMPAT_H__
 
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#if defined(__clang__)
+_Pragma("clang diagnostic push")
+_Pragma("clang diagnostic ignored \"-Wuninitialized\"")
+_Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"")
+#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
 _Pragma("GCC diagnostic push")
 _Pragma("GCC diagnostic ignored \"-Wstrict-prototypes\"")
 _Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
 #endif
 #include <jsapi.h>
 #include <jsdbgapi.h> // Needed by some bits
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#if defined(__clang__)
+_Pragma("clang diagnostic pop")
+#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
 _Pragma("GCC diagnostic pop")
 #endif
 #include <glib.h>


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