summaryrefslogtreecommitdiff
path: root/xlsclients.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-24 17:55:37 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-24 17:55:37 -0700
commit977636f190306bddbe3d09123283484ff5bd1b33 (patch)
tree1fb896105b1ddeaaa4e9fa456574dcda86d87291 /xlsclients.c
parentc8d8a4e66279130605b73b5dcef61c31ae414d57 (diff)
Quiet -Wmaybe-uninitialized warnings from gcc
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 <alan.coopersmith@oracle.com>
Diffstat (limited to 'xlsclients.c')
-rw-r--r--xlsclients.c6
1 files 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;