diff options
author | Philip Withnall <pwithnall@gnome.org> | 2023-12-04 13:11:05 +0000 |
---|---|---|
committer | Philip Withnall <pwithnall@gnome.org> | 2023-12-04 13:12:21 +0000 |
commit | 9ce3ed6bf9f2c95db12ed3b67bd5fb1f925aca17 (patch) | |
tree | 17fd9b18fe4fa7411345b89006406fdf46be32bb | |
parent | 455514898c11b9294c392f92170ef6802aa4ed2b (diff) |
build: Add a selection of stricter compiler warnings
This list is copied from GLib, where it’s been developed over a few
years to provide a balance between false positives and true positives
for low-level code.
https://gitlab.gnome.org/GNOME/glib/-/blob/70607ba417a27579093bef63b306977cfe54c87e/meson.build#L521
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
-rw-r--r-- | meson.build | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 0b504c6..f0fa77c 100644 --- a/meson.build +++ b/meson.build @@ -8,8 +8,22 @@ add_project_arguments( '-D_POSIX_C_SOURCE=200809L', '-DXDG_PREFIX=xdg_test', '-DHAVE_MMAP', - '-Wmissing-prototypes', + '-Wduplicated-branches', + '-Wimplicit-fallthrough', + '-Wmisleading-indentation', + '-Wmissing-field-initializers', + '-Wnonnull', + '-Wstrict-prototypes', + '-Wunused', + '-Werror=format=2', + '-Werror=implicit-function-declaration', + '-Werror=init-self', + '-Werror=missing-include-dirs', + '-Werror=missing-prototypes', + '-Werror=pointer-arith', + '-Werror=pointer-sign', '-Werror=sign-compare', + '-Werror=unused-result', language: 'c', native: true, ) |