libfprint/SOURCES/0085-meson-Use-stricter-C-arguments-to-compile-libfprint.patch
2021-09-09 20:12:48 +00:00

73 lines
2.2 KiB
Diff

From 59ef7ba5213ea17a451c2d0f2806a5f70181721c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Wed, 4 Dec 2019 14:27:33 +0100
Subject: [PATCH 085/181] 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')
--
2.24.1