[gnome-shell] build: Fix some harmless compiler warnings



commit bf367daabac40d7f76475a7a41f99f00f4600934
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Mar 2 18:16:25 2020 +0100

    build: Fix some harmless compiler warnings
    
    Some (newer?) GCC versions complain when a g_auto variable isn't
    initialized when declared, even when the initialization is guaranteed
    to happen before the variable is used or goes out of scope.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/2298

 src/shell-app.c                                  | 2 +-
 src/st/st-texture-cache.c                        | 2 +-
 subprojects/extensions-tool/src/command-create.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index 0d314bbb3c..090c6d3d28 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -1295,7 +1295,7 @@ apply_discrete_gpu_env (GAppLaunchContext *context,
   num_children = g_variant_n_children (variant);
   for (i = 0; i < num_children; i++)
     {
-      g_autoptr(GVariant) gpu;
+      g_autoptr(GVariant) gpu = NULL;
       g_autoptr(GVariant) env = NULL;
       g_autoptr(GVariant) default_variant = NULL;
       g_autofree const char **env_s = NULL;
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index bb614c6b43..758c0215f5 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -142,7 +142,7 @@ on_icon_theme_changed (StSettings     *settings,
                        GParamSpec     *pspec,
                        StTextureCache *cache)
 {
-  g_autofree gchar *theme;
+  g_autofree gchar *theme = NULL;
 
   st_texture_cache_evict_icons (cache);
 
diff --git a/subprojects/extensions-tool/src/command-create.c 
b/subprojects/extensions-tool/src/command-create.c
index 2c140bba0b..e32e7c262b 100644
--- a/subprojects/extensions-tool/src/command-create.c
+++ b/subprojects/extensions-tool/src/command-create.c
@@ -89,7 +89,7 @@ create_metadata (GFile       *target_dir,
 static gboolean
 copy_extension_template (GFile *target_dir, GError **error)
 {
-  g_auto (GStrv) templates;
+  g_auto (GStrv) templates = NULL;
   char **s;
 
   templates = g_resources_enumerate_children (TEMPLATE_PATH, 0, NULL);


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