[igt-dev] [PATCH i-g-t 4/4] meson: Enable more warning flags
Petri Latvala
petri.latvala at intel.com
Mon Oct 29 14:30:54 UTC 2018
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 <petri.latvala at intel.com>
---
assembler/meson.build | 18 ++++++++++++++++++
meson.build | 44 ++++++++++++++++++++++++++++++++++++++-----
2 files changed, 57 insertions(+), 5 deletions(-)
diff --git a/assembler/meson.build b/assembler/meson.build
index cefdba93..3b4af348 100644
--- a/assembler/meson.build
+++ b/assembler/meson.build
@@ -11,7 +11,23 @@ lib_brw_src = [
'ralloc.c',
]
+assembler_warnflags = [
+ '-Wno-declaration-after-statement',
+ '-Wno-discarded-qualifiers',
+ '-Wno-missing-format-attribute',
+ '-Wno-old-style-definition',
+ '-Wno-redundant-decls',
+ '-Wno-shadow',
+]
+assembler_args = []
+foreach flag : assembler_warnflags
+ if cc.has_argument(flag)
+ assembler_args += flag
+ endif
+endforeach
+
lib_brw = static_library('brw', lib_brw_src,
+ c_args : assembler_args,
dependencies : igt_deps)
flex = find_program('flex')
@@ -30,9 +46,11 @@ pgen = generator(bison,
pfiles = pgen.process('gram.y')
executable('intel-gen4asm', 'main.c', lfiles, pfiles,
+ c_args : assembler_args,
link_with : lib_brw, install : true)
executable('intel-gen4disasm', 'disasm-main.c',
+ c_args : assembler_args,
link_with : lib_brw, install : true)
conf_data = configuration_data()
diff --git a/meson.build b/meson.build
index eff35585..f74d901c 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
--
2.18.0
More information about the igt-dev
mailing list