[nautilus/wip/ernestask/warnings: 7/14] meson.build: add a set of warnings



commit f237658a8a1987c370402585ba7abba3a30b0b35
Author: Ernestas Kulik <ernestask gnome org>
Date:   Mon Feb 26 09:47:59 2018 +0200

    meson.build: add a set of warnings
    
    This commit adds a set of warnings that will always be used and makes
    some of them hard errors to help write code that is less bug-prone.

 meson.build | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 1c6976797..219e4b1b9 100644
--- a/meson.build
+++ b/meson.build
@@ -4,8 +4,6 @@ project('nautilus', 'c',
   license: 'GPL3+'
 )
 
-add_global_arguments('-Wno-deprecated-declarations', language: 'c')
-
 # Directory variables
 bindir = get_option('bindir')
 datadir = get_option('datadir')
@@ -21,6 +19,34 @@ servicedir = join_paths(datadir, 'dbus-1', 'services')
 cc = meson.get_compiler('c')
 #
 
+add_global_arguments(
+  cc.get_supported_arguments([
+    '-Wno-deprecated-declarations',
+  ]),
+  language: 'c'
+)
+add_project_arguments(
+  cc.get_supported_arguments([
+    '-Wall',
+    '-Wduplicated-branches',
+    '-Wlogical-op',
+    '-Werror=declaration-after-statement',
+    '-Werror=empty-body',
+    '-Werror=format=2',
+    '-Werror=implicit-function-declaration',
+    '-Werror=init-self',
+    '-Werror=missing-include-dirs',
+    '-Werror=missing-prototypes',
+    '-Werror=pointer-arith',
+    '-Werror=sequence-point',
+    '-Werror=shadow',
+    '-Werror=strict-prototypes',
+    '-Werror=undef',
+    '-Werror=uninitialized',
+  ]),
+  language: 'c'
+)
+
 # Imports
 gnome = import('gnome')
 i18n = import('i18n')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]