[gtk/wip/otte/for-master: 3/4] build: Add more useful warning flags



commit c9ff95e7623709e96182be1c0e7d393f667a1a30
Author: Benjamin Otte <otte redhat com>
Date:   Thu Mar 5 03:58:29 2020 +0100

    build: Add more useful warning flags
    
    I found those on the interwebs and decided they are useful.

 gdk/gdkrgbaprivate.h | 2 +-
 meson.build          | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gdk/gdkrgbaprivate.h b/gdk/gdkrgbaprivate.h
index 5126f57355..fc355f5913 100644
--- a/gdk/gdkrgbaprivate.h
+++ b/gdk/gdkrgbaprivate.h
@@ -28,7 +28,7 @@
                                         ((c) >= 'a' && (c) <= 'f') ? ((c)-'a'+10) : \
                                         ((c) >= '0' && (c) <= '9') ? ((c)-'0') : \
                                         -1))
-#define _GDK_RGBA_SELECT_COLOR(_str, index3, index6) _GDK_RGBA_DECODE (sizeof(_str) <= 4 ? (_str)[index3] : 
(_str)[index6])
+#define _GDK_RGBA_SELECT_COLOR(_str, index3, index6) (sizeof(_str) <= 4 ? _GDK_RGBA_DECODE ((_str)[index3]) 
: _GDK_RGBA_DECODE ((_str)[index6]))
 #define GDK_RGBA(str) ((GdkRGBA) {\
     ((_GDK_RGBA_SELECT_COLOR(str, 0, 0) << 4) | _GDK_RGBA_SELECT_COLOR(str, 0, 1)) / 255., \
     ((_GDK_RGBA_SELECT_COLOR(str, 1, 2) << 4) | _GDK_RGBA_SELECT_COLOR(str, 1, 3)) / 255., \
diff --git a/meson.build b/meson.build
index 2ba1516d7e..6fd7d68b45 100644
--- a/meson.build
+++ b/meson.build
@@ -238,16 +238,20 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
   test_cflags = [
     '-fno-strict-aliasing',
     '-Wcast-align',
+    '-Wduplicated-branches',
+    '-Wduplicated-cond',
     '-Wformat=2',
     '-Wformat-nonliteral',
     '-Wformat-security',
     '-Wignored-qualifiers',
     '-Wimplicit-function-declaration',
     '-Wlogical-op',
+    '-Wmisleading-indentation',
     '-Wmissing-format-attribute',
     '-Wmissing-include-dirs',
     '-Wmissing-noreturn',
     '-Wnested-externs',
+    '-Wnull-dereference',
     '-Wold-style-definition',
     '-Wpointer-arith',
     '-Wshadow',


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