]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
meson: Enable more compiler warnings
authorSimon McVittie <smcv@collabora.com>
Fri, 15 Jul 2022 10:38:26 +0000 (11:38 +0100)
committerSimon McVittie <smcv@collabora.com>
Fri, 15 Jul 2022 11:25:39 +0000 (12:25 +0100)
This provides parity with what we did in Autotools (most of it via
AX_COMPILER_FLAGS_CFLAGS).

Signed-off-by: Simon McVittie <smcv@collabora.com>
meson.build

index 99dfa90005c69cea27f79070b9d6ea0676d59c4e..3e11cb006f753b2a76b912df1208a4b4b68a2846 100644 (file)
@@ -1055,12 +1055,51 @@ else
       '-Wno-missing-field-initializers',
       '-Wno-unused-parameter',
 
+      # General warnings for both C and C++
+      # TODO: Some of these are probably redundant with Meson's warning_level
+      '-Warray-bounds',
+      '-Wcast-align',
       '-Wchar-subscripts',
+      '-Wdouble-promotion',
+      '-Wduplicated-branches',
+      '-Wduplicated-cond',
       '-Wfloat-equal',
+      '-Wformat-nonliteral',
+      '-Wformat-security',
+      '-Wformat=2',
+      '-Winit-self',
+      '-Winline',
+      '-Wlogical-op',
+      '-Wmissing-declarations',
+      '-Wmissing-format-attribute',
+      '-Wmissing-include-dirs',
+      '-Wmissing-noreturn',
+      '-Wnull-dereference',
+      '-Wpacked',
+      '-Wpointer-arith',
+      '-Wredundant-decls',
+      '-Wrestrict',
+      '-Wreturn-type',
+      '-Wshadow',
+      '-Wsign-compare',
+      '-Wstrict-aliasing',
+      '-Wswitch-default',
+      '-Wswitch-enum',
+      '-Wundef',
+      '-Wunused-but-set-variable',
+      '-Wwrite-strings',
   ]
 
   compile_warnings_c += [
+      # Extra warnings just for C
+      '-Wdeclaration-after-statement',
+      '-Wimplicit-function-declaration',
+      '-Wjump-misses-init',
+      '-Wmissing-prototypes',
+      '-Wnested-externs',
+      '-Wold-style-definition',
       '-Wpointer-sign',
+      '-Wstrict-prototypes',
   ]
 endif