[gtk/wip/baedert/for-master] build: Only add -Wcast-align for gcc



commit 57c15e7e1bfc610f460afd270fe2b962e11bc506
Author: Timm Bäder <mail baedert org>
Date:   Sat Oct 10 08:43:52 2020 +0200

    build: Only add -Wcast-align for gcc
    
    Either we or clang needs to get its shit together about this warning.
    But using it during development with clang just makes actually usable
    warnings get lost in a flood of -Wcast-align warnings.

 meson.build | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 85a605c2c9..8098de35a1 100644
--- a/meson.build
+++ b/meson.build
@@ -251,7 +251,6 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
     '-Wno-c++11-extensions',
     '-Wno-missing-include-dirs',
     '-Wno-typedef-redefinition',
-    '-Wcast-align',
     '-Wduplicated-branches',
     '-Wduplicated-cond',
     '-Wformat=2',
@@ -295,6 +294,10 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
     '-Werror=vla',
     '-Werror=write-strings',
   ]
+
+  if cc.get_id() == 'gcc'
+    test_cflags += ['-Wcast-align'] # This warns too much on clang
+  endif
 else
   test_cflags = []
 endif


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