[hackers] [slstatus] Properly declare buf as extern and fix all unused-warnings || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Sun, 17 Sep 2017 17:45:57 +0200 (CEST)

commit 914440b4fc3c5ecb7d9eedf4da6f2a1c7ec2e7a9
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Sun Sep 17 17:21:54 2017 +0200
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Sun Sep 17 17:38:07 2017 +0200

    Properly declare buf as extern and fix all unused-warnings

diff --git a/config.mk b/config.mk
index adb0a70..df0892e 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -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
 
diff --git a/slstatus.c b/slstatus.c
index b4eb761..89a3268 100644
--- a/slstatus.c
+++ b/slstatus.c
_AT_@ -10,6 +10,7 @@
 #include <X11/Xlib.h>
 
 #include "arg.h"
+#include "slstatus.h"
 #include "util.h"
 
 struct arg {
_AT_@ -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 6f47e85..8321f9d 100644
--- a/util.h
+++ b/util.h
_AT_@ -1,4 +1,4 @@
-static char buf[1024];
+extern char buf[1024];
 
 #define LEN(x) (sizeof (x) / sizeof *(x))
 
Received on Sun Sep 17 2017 - 17:45:57 CEST

This archive was generated by hypermail 2.3.0 : Sun Sep 17 2017 - 17:48:32 CEST