Properly declare buf as extern and fix all unused-warnings
authorLaslo Hunhold <dev@frign.de>
Sun, 17 Sep 2017 15:21:54 +0000 (17:21 +0200)
committerAaron Marcher <me@drkhsh.at>
Sun, 17 Sep 2017 15:38:07 +0000 (17:38 +0200)
config.mk
slstatus.c
util.h

index adb0a709fbe489742e7f76e1138925967ef047b5..df0892e4aee0f4ac1502ad851b3ad55497279ebd 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -12,7 +12,7 @@ X11LIB = /usr/X11R6/lib
 
 # flags
 CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE
-CFLAGS   = -std=c99 -pedantic -Wall -Wextra -Wno-unused -Os
+CFLAGS   = -std=c99 -pedantic -Wall -Wextra -Os
 LDFLAGS  = -L$(X11LIB) -s
 LDLIBS   = -lX11
 
index b4eb76124e9a7791578090041e1626ae80dd8359..89a3268697f6dab16a55266237ab040828306049 100644 (file)
@@ -10,6 +10,7 @@
 #include <X11/Xlib.h>
 
 #include "arg.h"
+#include "slstatus.h"
 #include "util.h"
 
 struct arg {
@@ -19,15 +20,17 @@ struct arg {
 };
 
 char *argv0;
+char buf[1024];
 static unsigned short int done;
 static Display *dpy;
 
-#include "slstatus.h"
 #include "config.h"
 
 static void
 terminate(const int signo)
 {
+       (void)signo;
+
        done = 1;
 }
 
diff --git a/util.h b/util.h
index 6f47e856c4e8a799a18709db9eec6ca95ac06943..8321f9db2eddbe67918761a3151d39b4c0870041 100644 (file)
--- a/util.h
+++ b/util.h
@@ -1,4 +1,4 @@
-static char buf[1024];
+extern char buf[1024];
 
 #define LEN(x) (sizeof (x) / sizeof *(x))