]> git.scottworley.com Git - batteryviewer/commitdiff
-Wall -Wextra -pedantic -Werror
authorScott Worley <scottworley@scottworley.com>
Thu, 23 Feb 2023 03:51:54 +0000 (19:51 -0800)
committerScott Worley <scottworley@scottworley.com>
Thu, 23 Feb 2023 03:51:54 +0000 (19:51 -0800)
Makefile
batteryviewer.c

index 20e658b728f67251a008f6970bb3fef7d416eb19..5a1cc252323e588a76a9adceb14c88ded8a27622 100644 (file)
--- 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
 
index 4a1a8509076c4e0225b104c21a31b52a09886ac2..7be007c3ff54aad376199c1e38bd32fbb0dd04d8 100644 (file)
@@ -1,10 +1,12 @@
 #include <gtk/gtk.h>
 
-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;