From 7fd5da2567d054d7473b6a46075de9d997a529d2 Mon Sep 17 00:00:00 2001 From: Petri Latvala Date: Mon, 29 Oct 2018 16:30:54 +0200 Subject: meson: Enable more warning flags We had quite a bit of warning flags active on autotools builds that were not used for meson builds. Add the same flags autotools builds used to what meson was using (some flags autotools didn't have). For the assembler, disable some of the flags to make it build cleanly again. Signed-off-by: Petri Latvala Reviewed-by: Arkadiusz Hiler --- meson.build | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index d1e35757..469723dc 100644 --- a/meson.build +++ b/meson.build @@ -10,14 +10,48 @@ project('igt-gpu-tools', 'c', cc = meson.get_compiler('c') cc_args = [ - '-Wno-unused-parameter', - '-Wno-sign-compare', - '-Wno-missing-field-initializers', + '-Wbad-function-cast', + '-Wdeclaration-after-statement', + '-Wformat=2', +# igt_assert(0) in switch statements triggers a bunch of this. + '-Wimplicit-fallthrough=0', + '-Wlogical-op', + '-Wmissing-declarations', + '-Wmissing-format-attribute', + '-Wmissing-noreturn', + '-Wmissing-prototypes', + '-Wnested-externs', + '-Wold-style-definition', + '-Wpointer-arith', + '-Wredundant-decls', + '-Wshadow', + '-Wstrict-prototypes', + '-Wuninitialized', + '-Wunused', + '-Wno-clobbered', + '-Wno-maybe-uninitialized', + '-Wno-missing-field-initializers', + '-Wno-pointer-arith', + '-Wno-sign-compare', # Macros asserting on the range of their arguments triggers this. '-Wno-type-limits', -# igt_assert(0) in switch statements triggers a bunch of this. - '-Wimplicit-fallthrough=0', + '-Wno-unused-parameter', + '-Wno-unused-result', + + '-Werror=address', + '-Werror=array-bounds', + '-Werror=implicit', + '-Werror=init-self', + '-Werror=int-to-pointer-cast', + '-Werror=main', + '-Werror=missing-braces', + '-Werror=nonnull', + '-Werror=pointer-to-int-cast', + '-Werror=return-type', + '-Werror=sequence-point', + '-Werror=trigraphs', + '-Werror=write-strings', ] foreach cc_arg : cc_args -- cgit v1.2.3