[mutter] meson.build: Add more compilation warnings



commit 25f416c13dbf1e35ee80061545d1d087333190d2
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Sun Jan 20 17:44:22 2019 +0100

    meson.build: Add more compilation warnings
    
    So that we can catch more issues. The warning list is copied from GTK+,
    with two switch related ones removed.

 meson.build | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
---
diff --git a/meson.build b/meson.build
index 0c021fb09..4db8b8cfc 100644
--- a/meson.build
+++ b/meson.build
@@ -270,6 +270,48 @@ endforeach
 
 add_project_arguments('-D_GNU_SOURCE', language: 'c')
 
+all_warnings = [
+  '-fno-strict-aliasing',
+  '-Wpointer-arith',
+  '-Wmissing-declarations',
+  '-Wimplicit-function-declaration',
+  '-Wformat=2',
+  '-Wformat-nonliteral',
+  '-Wformat-security',
+  '-Wstrict-prototypes',
+  '-Wmissing-prototypes',
+  '-Wnested-externs',
+  '-Wold-style-definition',
+  '-Wundef',
+  '-Wunused',
+  '-Wcast-align',
+  '-Wmissing-noreturn',
+  '-Wmissing-format-attribute',
+  '-Wmissing-include-dirs',
+  '-Wlogical-op',
+  '-Wignored-qualifiers',
+  '-Werror=redundant-decls',
+  '-Werror=implicit',
+  '-Werror=nonnull',
+  '-Werror=init-self',
+  '-Werror=main',
+  '-Werror=missing-braces',
+  '-Werror=sequence-point',
+  '-Werror=return-type',
+  '-Werror=trigraphs',
+  '-Werror=array-bounds',
+  '-Werror=write-strings',
+  '-Werror=address',
+  '-Werror=int-to-pointer-cast',
+  '-Werror=pointer-to-int-cast',
+  '-Werror=empty-body',
+  '-Werror=write-strings',
+]
+
+supported_warnings = cc.get_supported_arguments(all_warnings)
+
+add_project_arguments(supported_warnings, language: 'c')
+
 debug_c_args = []
 buildtype = get_option('buildtype')
 if buildtype.startswith('debug')


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