Enable more compiler warnings

This commit is contained in:
Consolatis 2023-01-31 03:35:13 +01:00
parent 1995a33df9
commit 82e9e866ec
12 changed files with 37 additions and 19 deletions

View file

@ -19,13 +19,24 @@ add_project_arguments(
cc = meson.get_compiler('c')
add_project_arguments(cc.get_supported_arguments(
[
'-Wno-unused-parameter',
add_project_arguments(cc.get_supported_arguments([
'-Wundef',
]),
language: 'c',
)
'-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)

View 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");

View 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)

View file

@ -2,6 +2,7 @@
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include "common/string-helpers.h"
static void
rtrim(char **s)

View file

@ -530,7 +530,7 @@ rcxml_parse_xml(struct buf *b)
}
static void
rcxml_init()
rcxml_init(void)
{
static bool has_run;

View 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;

View 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)
{
/*

View 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"

View file

@ -2,6 +2,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "key-state.h"
#define MAX_PRESSED_KEYS (16)

View 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 {

View 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

View 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];