]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Enable more compiler warnings
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Tue, 31 Jan 2023 02:35:13 +0000 (03:35 +0100)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 1 Feb 2023 09:42:22 +0000 (10:42 +0100)
12 files changed:
meson.build
src/common/dir.c
src/common/scene-helpers.c
src/common/string-helpers.c
src/config/rcxml.c
src/config/session.c
src/cursor.c
src/debug.c
src/key-state.c
src/resistance.c
src/server.c
src/xbm/tokenize.c

index 87d359dc1b0f0a5996dabc97172d7dcf57d6abd5..ecd26d9ae01ed06aaff6ebde74724434cd3eb478 100644 (file)
@@ -19,13 +19,24 @@ add_project_arguments(
 
 cc = meson.get_compiler('c')
 
-add_project_arguments(cc.get_supported_arguments(
-  [
-    '-Wno-unused-parameter',
-    '-Wundef',
-  ]),
-  language: 'c',
-)
+add_project_arguments(cc.get_supported_arguments([
+  '-Wundef',
+  '-Wlogical-op',
+  '-Wmissing-include-dirs',
+  '-Wold-style-definition',
+  '-Wpointer-arith',
+  '-Winit-self',
+  '-Wstrict-prototypes',
+  '-Wimplicit-fallthrough=2',
+  '-Wendif-labels',
+  '-Wstrict-aliasing=2',
+  '-Woverflow',
+  '-Wmissing-prototypes',
+  '-Walloca',
+  '-Wunused-macros',
+
+  '-Wno-unused-parameter',
+]), language: 'c')
 
 version='"@0@"'.format(meson.project_version())
 git = find_program('git', native: true, required: false)
index 8e24153078fb58b2285057f0ae70bfee6f6be467..85dfea147e34c3590984171074fc6d19d258b876 100644 (file)
@@ -73,7 +73,7 @@ build_theme_path(struct ctx *ctx, char *prefix, const char *path)
        }
 }
 
-char *
+static char *
 find_dir(struct ctx *ctx)
 {
        char *debug = getenv("LABWC_DEBUG_DIR_CONFIG_AND_THEME");
index 6bda9bd7aaa1f99e12d007d04fa01f8f46d3db49..ee94135819ada6c71dd1d779f71fbeec34f8fe85 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <assert.h>
 #include <wlr/types/wlr_scene.h>
+#include "common/scene-helpers.h"
 
 struct wlr_scene_rect *
 lab_wlr_scene_get_rect(struct wlr_scene_node *node)
index 8513ee0cee09bd873561704731b8f13c4aac6a10..3900d673e7010805d6c2401d29f8c2cf0ddc505d 100644 (file)
@@ -2,6 +2,7 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
+#include "common/string-helpers.h"
 
 static void
 rtrim(char **s)
index 4d3bf6d9d384a876e8998f3a37f3019f2aa5155d..cbb0ca8396e63ca515dfe8460b8b4b15b27fbabb 100644 (file)
@@ -530,7 +530,7 @@ rcxml_parse_xml(struct buf *b)
 }
 
 static void
-rcxml_init()
+rcxml_init(void)
 {
        static bool has_run;
 
index 71855c9e7e76ab0eae63f395486f3a7a19fcbfc9..09f4dc015d2135a6e7761f47f652c36904dbb967 100644 (file)
@@ -11,6 +11,7 @@
 #include "common/mem.h"
 #include "common/spawn.h"
 #include "common/string-helpers.h"
+#include "config/session.h"
 
 static bool
 isfile(const char *path)
@@ -51,7 +52,7 @@ error:
        free(value.buf);
 }
 
-void
+static void
 read_environment_file(const char *filename)
 {
        char *line = NULL;
index 299c76b74e151e3708975a01df47a18ee2691dc0..2728e901e1db4313eab5ba1e298cdba2507bb033 100644 (file)
@@ -515,7 +515,7 @@ cursor_update_focus(struct server *server)
                /*cursor_has_moved*/ false);
 }
 
-void
+static void
 handle_constraint_commit(struct wl_listener *listener, void *data)
 {
        struct seat *seat = wl_container_of(listener, seat, constraint_commit);
@@ -523,7 +523,7 @@ handle_constraint_commit(struct wl_listener *listener, void *data)
        assert(constraint->surface = data);
 }
 
-void
+static void
 destroy_constraint(struct wl_listener *listener, void *data)
 {
        struct constraint *constraint = wl_container_of(listener, constraint,
@@ -621,7 +621,7 @@ cursor_motion(struct wl_listener *listener, void *data)
        process_cursor_motion(seat->server, event->time_msec);
 }
 
-void
+static void
 cursor_motion_absolute(struct wl_listener *listener, void *data)
 {
        /*
@@ -890,7 +890,7 @@ cursor_button_release(struct seat *seat, struct wlr_pointer_button_event *event)
        }
 }
 
-void
+static void
 cursor_button(struct wl_listener *listener, void *data)
 {
        /*
@@ -943,7 +943,7 @@ compare_delta(const struct wlr_pointer_axis_event *event, double *accum)
        return 0;
 }
 
-bool
+static bool
 handle_cursor_axis(struct server *server, struct cursor_context *ctx,
                struct wlr_pointer_axis_event *event)
 {
@@ -989,7 +989,7 @@ handle_cursor_axis(struct server *server, struct cursor_context *ctx,
        return handled;
 }
 
-void
+static void
 cursor_axis(struct wl_listener *listener, void *data)
 {
        /*
@@ -1016,7 +1016,7 @@ cursor_axis(struct wl_listener *listener, void *data)
        }
 }
 
-void
+static void
 cursor_frame(struct wl_listener *listener, void *data)
 {
        /*
index 9ad0910b7a2bcc7a2821d4a37de67cbfd593761b..b0548e740fa15cbcee0f5c8d652a3ccfb67f1285 100644 (file)
@@ -2,6 +2,7 @@
 #include <wlr/types/wlr_layer_shell_v1.h>
 #include <wlr/types/wlr_scene.h>
 #include "common/scene-helpers.h"
+#include "debug.h"
 #include "labwc.h"
 #include "node.h"
 #include "ssd.h"
index 2175e46dd5cc2f5f69aeba4e3dbcd6d856597300..f95d480c2dd2ea72b55c69d8adb79f1f126d09aa 100644 (file)
@@ -2,6 +2,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <string.h>
+#include "key-state.h"
 
 #define MAX_PRESSED_KEYS (16)
 
index 2f40ca15d4418be21644e3add60a308bbce2798c..9d1afb70fef7f03bf8cb73e09d830848d6a93cdf 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include "config/rcxml.h"
 #include "labwc.h"
+#include "resistance.h"
 #include "view.h"
 
 struct edges {
index 7fbc38056c7c6e30fbea61e47ca7be89bdbf3175..3d36526caabe92d7c8c3c2020a4fd483e001447a 100644 (file)
@@ -159,6 +159,7 @@ server_global_filter(const struct wl_client *client, const struct wl_global *glo
 {
        const struct wl_interface *iface = wl_global_get_interface(global);
        struct server *server = (struct server *)data;
+       /* Silence unused var compiler warnings */
        (void)iface; (void)server;
 
 #if HAVE_XWAYLAND
index 218d0bd221f3aedaf72dd765e04bacbbb53f4935..4675c0f050e394515543f82bd17435fb1c9219c2 100644 (file)
@@ -30,7 +30,7 @@ add_token(enum token_type token_type)
 }
 
 static void
-get_identifier_token()
+get_identifier_token(void)
 {
        struct token *token = tokens + nr_tokens - 1;
        token->name[token->pos] = current_buffer_position[0];
@@ -79,7 +79,7 @@ get_number_token(void)
 }
 
 static void
-get_special_char_token()
+get_special_char_token(void)
 {
        struct token *token = tokens + nr_tokens - 1;
        token->name[0] = current_buffer_position[0];