[gnome-builder] clang: work around inline incompat between GCC/Clang



commit 97bf7dd773070331e011ccec5bfecfd004a79915
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 2 14:48:00 2019 -0700

    clang: work around inline incompat between GCC/Clang
    
    This makes Builder significantly less annoying in cases where Clang warns
    about static inlines that do not matter in the "edit header" case.
    
    Fixes #961

 src/plugins/clang/ide-clang.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/plugins/clang/ide-clang.c b/src/plugins/clang/ide-clang.c
index 04efb318d..05e38390f 100644
--- a/src/plugins/clang/ide-clang.c
+++ b/src/plugins/clang/ide-clang.c
@@ -210,6 +210,13 @@ ide_clang_cook_flags (const gchar         *path,
       include = g_strdup_printf ("-I%s", current);
     }
 
+  /* Work around Clang/GCC inconsistency on -Wunused-function with regards
+   * to static inline usage.
+   *
+   * See https://gitlab.gnome.org/GNOME/gnome-builder/issues/961
+   */
+  g_ptr_array_add (cooked, g_strdup ("-Dinline=inline __attribute__((unused))"));
+
   if (flags != NULL)
     {
       for (guint i = 0; flags[i]; i++)


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