From 3f6823092ad9bfa1def3c33e5d3c2d3cdbc676fa Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Sat, 31 Mar 2018 12:55:36 +0300 Subject: [PATCH] Initialize roots_output to fix -Wmaybe-uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With -O2: ../rootston/desktop.c: In function ‘desktop_surface_at’: ../rootston/desktop.c:714:18: error: ‘roots_output’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if ((surface = layer_surface_at(roots_output, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &roots_output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ox, oy, sx, sy))) { ~~~~~~~~~~~~~~~ --- rootston/desktop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootston/desktop.c b/rootston/desktop.c index 0668d8cb..c2e424cf 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -682,7 +682,7 @@ struct wlr_surface *desktop_surface_at(struct roots_desktop *desktop, struct wlr_surface *surface = NULL; struct wlr_output *wlr_output = wlr_output_layout_output_at(desktop->layout, lx, ly); - struct roots_output *roots_output; + struct roots_output *roots_output = NULL; double ox = lx, oy = ly; *view = NULL;