From c678b9021c3b1d6a430cbd96833be2557fa5ad3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 4 Dec 2019 14:27:33 +0100 Subject: [PATCH] meson: Use stricter C arguments to compile libfprint These are based on what mutter does, being a quite strict project on c code quality. --- meson.build | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 65077c5..1561ebf 100644 --- a/meson.build +++ b/meson.build @@ -21,20 +21,49 @@ glib_version_def = 'GLIB_VERSION_@0@_@1@'.format( glib_min_version.split('.')[0], glib_min_version.split('.')[1]) common_cflags = cc.get_supported_arguments([ '-Wall', + '-Wcast-align', + '-Wformat-nonliteral', + '-Wformat-security', + '-Wformat=2', + '-Wignored-qualifiers', + '-Wlogical-op', + '-Wmissing-declarations', + '-Wmissing-format-attribute', + '-Wmissing-include-dirs', + '-Wmissing-noreturn', + '-Wpointer-arith', + '-Wshadow', '-Wtype-limits', '-Wundef', '-Wunused', - '-Wstrict-prototypes', - '-Werror-implicit-function-declaration', - '-Wshadow', + '-Werror=address', + '-Werror=array-bounds', + '-Werror=empty-body', + '-Werror=init-self', + '-Werror=int-to-pointer-cast', + '-Werror=main', + '-Werror=missing-braces', + '-Werror=nonnull', + '-Werror=redundant-decls', + '-Werror=return-type', + '-Werror=sequence-point', + '-Werror=trigraphs', + '-Werror=write-strings', + '-fno-strict-aliasing', '-DGLIB_VERSION_MIN_REQUIRED=' + glib_version_def, '-DGLIB_VERSION_MAX_ALLOWED=' + glib_version_def, '-D_GNU_SOURCE', '-DG_LOG_DOMAIN="libfprint"', ]) c_cflags = cc.get_supported_arguments([ - '-fgnu89-inline', '-std=gnu99', + '-Wimplicit-function-declaration', + '-Wmissing-prototypes', + '-Wnested-externs', + '-Wold-style-definition', + '-Wstrict-prototypes', + '-Werror=implicit', + '-Werror=pointer-to-int-cast', ]) add_project_arguments(common_cflags + c_cflags, language: 'c') add_project_arguments(common_cflags, language: 'cpp')