[gtk/wip/otte/macos-werror: 7/8] build: Turn off tautological-constant-out-of-range-compare warning
- From: Benjamin Otte <otte src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gtk/wip/otte/macos-werror: 7/8] build: Turn off tautological-constant-out-of-range-compare warning
 
- Date: Thu,  4 Nov 2021 00:42:15 +0000 (UTC)
 
commit f6e06008f9a601e727e7b7fc2bf8c536875bfdea
Author: Benjamin Otte <otte redhat com>
Date:   Thu Nov 4 00:27:27 2021 +0100
    build: Turn off tautological-constant-out-of-range-compare warning
    
    This issues a warning when an enum value is compared to a value that is
    out of range for the enum.
    
    We do this a lot, either when using -1 for undefined values or when
    comparing array sizes to enum values like so:
    
      enum {
        ONE,
        TWO,
        THREE
      } some_enum_value;
      const char *names= { "one", "two", "three" };
    
      g_assert (some_enum_value < G_N_ELEMENTS (names));
 meson.build | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/meson.build b/meson.build
index fd98ff0a3d..d6a21be8b9 100644
--- a/meson.build
+++ b/meson.build
@@ -269,6 +269,7 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
     '-Wno-c++11-extensions',
     '-Wno-missing-include-dirs',
     '-Wno-typedef-redefinition',
+    '-Wno-tautological-constant-out-of-range-compare',
     '-Wduplicated-branches',
     '-Wduplicated-cond',
     '-Wformat=2',
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]