meson.build: add a few compiler warnings and make them compiler-conditional
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 9 Sep 2020 01:53:12 +0000 (11:53 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 9 Sep 2020 03:57:39 +0000 (13:57 +1000)
These seem like a decent-enough set to have, only -Wlogical-op actually
produced a new warning.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
meson.build

index 963c25b8b772548d0e090cd3c3ccf1ace12e2031..24837d28f36105c87ade41f8d936bd38d125d0d2 100644 (file)
@@ -45,11 +45,22 @@ cc = meson.get_compiler('c')
 cflags = [
        '-Wno-unused-parameter',
        '-Wmissing-prototypes',
-       '-Wstrict-prototypes'
+       '-Wstrict-prototypes',
+       '-Wundef',
+       '-Wlogical-op',
+       '-Wpointer-arith',
+       '-Wuninitialized',
+       '-Winit-self',
+       '-Wstrict-prototypes',
+       '-Wimplicit-fallthrough',
+       '-Wredundant-decls',
+       '-Wincompatible-pointer-types',
+       '-Wformat=2',
+       '-Wmissing-declarations',
 
        '-fvisibility=hidden',
 ]
-add_project_arguments(cflags, language : 'c')
+add_project_arguments(cc.get_supported_arguments(cflags), language : 'c')
 
 # config.h
 config_h = configuration_data()