[PATCH 1/2] wmcliphist: Fix -Wmaybe-uninitialized compiler warning.

5 views
Skip to first unread message

Torrance, Douglas

unread,
Oct 10, 2021, 6:47:55 AM10/10/21
to wmake...@googlegroups.com, Torrance, Douglas
In particular, the following warning:
wmcliphist.c: In function 'main':
wmcliphist.c:386:11: warning: 'icon_file' may be used uninitialized in this function
[-Wmaybe-uninitialized]
surface = cairo_image_surface_create_from_png(icon_file);
^
---
wmcliphist/wmcliphist.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/wmcliphist/wmcliphist.c b/wmcliphist/wmcliphist.c
index f86b466..5e06e1d 100644
--- a/wmcliphist/wmcliphist.c
+++ b/wmcliphist/wmcliphist.c
@@ -170,6 +170,9 @@ main(int argc, char **argv)
/* set the default window size */
gtk_window_set_default_size(GTK_WINDOW(dock_app), icon_size, icon_size);

+ /* set default icon */
+ icon_file = "ico_60x060_gray.png";
+
if (icon_size) {
/* create icon_mask */
if (icon_size == 60) {
--
2.30.2

Torrance, Douglas

unread,
Oct 10, 2021, 6:47:56 AM10/10/21
to wmake...@googlegroups.com, Torrance, Douglas, Helmut Grohne
Authored-By: Helmut Grohne <hel...@subdivi.de>
Bug: https://bugs.debian.org/941312
---
wmcliphist/Makefile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/wmcliphist/Makefile b/wmcliphist/Makefile
index c6dab1c..7b3ac71 100644
--- a/wmcliphist/Makefile
+++ b/wmcliphist/Makefile
@@ -1,10 +1,11 @@
srcCC ?= gcc
+PKG_CONFIG ?= pkg-config
INSTALL = install
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share/wmcliphist
MAN1DIR = $(PREFIX)/share/man/man1
-INCLUDES = `pkg-config --cflags gtk+-3.0 x11`
+INCLUDES = `$(PKG_CONFIG) --cflags gtk+-3.0 x11`

# for normal use
CFLAGS += -Wall -ansi -pedantic $(INCLUDES) -DDATADIR=\"$(DATADIR)\"
@@ -16,7 +17,7 @@ DEBUG =
#CFLAGS += -Wall -g -ansi $(INCLUDES) -DFNCALL_DEBUG -DDATADIR=\"$(DATADIR)\"
#DEBUG = debug.o

-LIBS = `pkg-config --libs gtk+-3.0 x11`
+LIBS = `$(PKG_CONFIG) --libs gtk+-3.0 x11`

OBJECTS = wmcliphist.o clipboard.o gui.o rcconfig.o history.o hotkeys.o utils.o $(DEBUG)
TARGET = wmcliphist
--
2.30.2
Reply all
Reply to author
Forward
0 new messages