]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: enable warnings
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 2 Nov 2022 03:38:07 +0000 (04:38 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Wed, 16 Nov 2022 17:00:25 +0000 (18:00 +0100)
meson.build

index 4ef8745c67d3e4856caab7e11d459a7e8562fef0..e7d14295f91193921a47c0553ad8d81652449c91 100644 (file)
@@ -777,6 +777,38 @@ configure_file(
 
 add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
 
+compiler_flags = [
+  '-fno-common',
+
+  '-Waddress-of-packed-member',
+  '-Wdiscarded-qualifiers',
+  '-Wembedded-directive',
+  '-Wextra-semi',
+  '-Wformat-security',
+  '-Wimplicit-function-declaration',
+  '-Wmissing-declarations',
+  '-Wmissing-parameter-type',
+  '-Wmissing-prototypes',
+  '-Wnested-externs',
+  '-Wno-missing-field-initializers',
+  '-Wpointer-arith',
+  '-Wredundant-decls',
+  '-Wsign-compare',
+  '-Wstrict-prototypes',
+  '-Wtype-limits',
+  '-Wuninitialized',
+  '-Wunused-but-set-parameter',
+  '-Wunused-but-set-variable',
+  '-Wunused-parameter',
+  '-Wunused-result',
+  '-Wunused-variable',
+]
+foreach compiler_flag : compiler_flags
+  if cc.has_argument(compiler_flag)
+    add_project_arguments(compiler_flag, language : 'c')
+  endif
+endforeach
+
 manadocs = []
 manlinks = {}