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




commit 2f09c047d50273f25e86a4dcda5b59cd74bbee5c
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 40f31f9f3c..ce6b962f4c 100644
--- a/meson.build
+++ b/meson.build
@@ -250,7 +250,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',
@@ -294,6 +293,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]