[gjs: 2/3] build: ignore Wmaybe-uninitialized in arg->v_pointer



commit 50c0e1f7f01a9bc14d3bdb100054cc0041449a6b
Author: Claudio André <claudioandre br gmail com>
Date:   Sat Jun 23 20:43:05 2018 -0300

    build: ignore Wmaybe-uninitialized in arg->v_pointer
    
    It prints a compiler false positive warning.
    
    [skip cpplint] gjs_value_to_g_argument() has more than 500 lines.
    This commit added a few more non-comment lines.

 gi/arg.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index ba1db1a4..f6c014ac 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -1930,7 +1930,18 @@ gjs_value_to_g_argument(JSContext      *context,
                                       &ghash)) {
                 wrong = true;
             } else {
+#if __GNUC__ >= 8
+_Pragma("GCC diagnostic push")
+_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+#endif
+                /* The compiler isn't smart enough to figure out that ghash
+                 * will always be initialized if gjs_object_to_g_hash()
+                 * returns true.
+                 */
                 arg->v_pointer = ghash;
+#if __GNUC__ >= 8
+_Pragma("GCC diagnostic pop")
+#endif
             }
 
             g_base_info_unref((GIBaseInfo*) key_param_info);


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