From 977636f190306bddbe3d09123283484ff5bd1b33 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 24 Oct 2022 17:55:37 -0700 Subject: Quiet -Wmaybe-uninitialized warnings from gcc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I think these were false positives, as the accesses were all inside "if (cs->verbose)" checks, matching the initialization case for them, but this makes gcc stop warning. xlsclients.c:531:13: warning: ‘wm_class’ may be used uninitialized [-Wmaybe-uninitialized] 531 | free(wm_class); | ^~~~~~~~~~~~~~ xlsclients.c:440:31: note: ‘wm_class’ was declared here 440 | xcb_get_property_reply_t *wm_class; | ^~~~~~~~ xlsclients.c:475:35: warning: ‘icon_name’ may be used uninitialized [-Wmaybe-uninitialized] 475 | if (icon_name && icon_name->type) | ~~~~~~~~~^~~~~~ xlsclients.c:439:31: note: ‘icon_name’ was declared here 439 | xcb_get_property_reply_t *icon_name; | ^~~~~~~~~ xlsclients.c:527:13: warning: ‘name’ may be used uninitialized [-Wmaybe-uninitialized] 527 | free(name); | ^~~~~~~~~~ xlsclients.c:438:31: note: ‘name’ was declared here 438 | xcb_get_property_reply_t *name; | ^~~~ Signed-off-by: Alan Coopersmith --- xlsclients.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xlsclients.c b/xlsclients.c index 6153927..548f958 100644 --- a/xlsclients.c +++ b/xlsclients.c @@ -435,9 +435,9 @@ show_client_properties(void *closure) client_state *cs = closure; xcb_get_property_reply_t *client_machine; xcb_get_property_reply_t *command; - xcb_get_property_reply_t *name; - xcb_get_property_reply_t *icon_name; - xcb_get_property_reply_t *wm_class; + xcb_get_property_reply_t *name = NULL; + xcb_get_property_reply_t *icon_name = NULL; + xcb_get_property_reply_t *wm_class = NULL; char *argv; int charsleft = cs->maxcmdlen; int i; -- cgit v1.2.3