NetworkManager/m4
Thomas Haller 4f9f228fed libnm: disable "-Wtautological-constant-out-of-range-compare" warning with clang
Seen on Debian 9, clang-3.8 (1:3.8.1-24):

    ../libnm-core/nm-setting-bond.c:596:49: error: comparison of constant 32 with expression of type 'NMBondMode' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
            nm_assert (_NM_INT_NOT_NEGATIVE (mode) && mode < 32);
                                                      ~~~~ ^ ~~

This warning is not useful. While it may be implementation defined how enum
values outside the defined ones are handled, we commonly rely on placing
special numeric values in enums (e.g. ((NMEnumType) -1)).

An enum is (with our compilers) just a glorified integer, and there is nothing
preventing it from being outside the enum values. The warning is not helpful
and outright wrong. Disable it.

See-also: https://bugs.llvm.org//show_bug.cgi?id=16154

Fixes: 957bb2e111 ('libnm: use binary search for _nm_setting_bond_option_supported() implementation')
2020-02-21 10:43:55 +01:00
..
attributes.m4 build: import attributes.m4 from systemd 2016-06-03 22:19:37 +02:00
ax_lib_readline.m4 build: correct help message about missing readline + termcap libraries 2015-05-11 10:33:21 -05:00
compiler_options.m4 libnm: disable "-Wtautological-constant-out-of-range-compare" warning with clang 2020-02-21 10:43:55 +01:00
git-sha-record.m4 build: move detection of NM_GIT_SHA to separate "m4/git-sha-record.m4" 2016-09-14 14:11:07 +02:00
gnome-code-coverage.m4 build: disable lcov version check 2017-10-20 17:16:22 +02:00
introspection.m4 all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
vapigen.m4 build: document defaults consistently 2019-04-16 15:57:20 +02:00