From: Simon McVittie Date: Fri, 15 Jul 2022 10:38:26 +0000 (+0100) Subject: meson: Enable more compiler warnings X-Git-Tag: dbus-1.15.0~28^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee364045492d44b9aad0814dc4fc5bcce0d6a4e2;p=thirdparty%2Fdbus.git meson: Enable more compiler warnings This provides parity with what we did in Autotools (most of it via AX_COMPILER_FLAGS_CFLAGS). Signed-off-by: Simon McVittie --- diff --git a/meson.build b/meson.build index 99dfa9000..3e11cb006 100644 --- a/meson.build +++ b/meson.build @@ -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