From: Scott Worley Date: Thu, 23 Feb 2023 03:51:54 +0000 (-0800) Subject: -Wall -Wextra -pedantic -Werror X-Git-Url: http://git.scottworley.com/batteryviewer/commitdiff_plain/d2485ebc69f6ceef5148ec84731c6bcf4b5407e4?ds=sidebyside;hp=79ac753b684a82d2acddb865d50d941525b5706d -Wall -Wextra -pedantic -Werror --- diff --git a/Makefile b/Makefile index 20e658b..5a1cc25 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +RECOMMENDED_CFLAGS = -Wall -Wextra -pedantic -Werror +CFLAGS = $(RECOMMENDED_CFLAGS) prefix = /usr/local exec_prefix = $(prefix) bindir = $(exec_prefix)/bin @@ -5,7 +7,7 @@ INSTALL = install -D INSTALL_PROGRAM = $(INSTALL) batteryviewer: batteryviewer.c - gcc $(shell pkg-config --cflags gtk4) -o $@ $< $(shell pkg-config --libs gtk4) + gcc $(shell pkg-config --cflags gtk4) -o $@ $(CFLAGS) $< $(shell pkg-config --libs gtk4) all: batteryviewer diff --git a/batteryviewer.c b/batteryviewer.c index 4a1a850..7be007c 100644 --- a/batteryviewer.c +++ b/batteryviewer.c @@ -1,10 +1,12 @@ #include -static void print_hello(GtkWidget *widget, gpointer data) { +static void print_hello(GtkWidget *widget __attribute__((unused)), + gpointer data __attribute__((unused))) { g_print("Hello World\n"); } -static void activate(GtkApplication *app, gpointer user_data) { +static void activate(GtkApplication *app, + gpointer user_data __attribute__((unused))) { GtkWidget *window; GtkWidget *button;