mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 10:14:41 +00:00
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')
This commit is contained in:
parent
16df1c179d
commit
4f9f228fed
|
@ -89,6 +89,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
|
|||
-Wno-missing-field-initializers \
|
||||
-Wno-pragmas \
|
||||
-Wno-sign-compare \
|
||||
-Wno-tautological-constant-out-of-range-compare \
|
||||
-Wno-unknown-pragmas \
|
||||
-Wno-unused-parameter \
|
||||
; do
|
||||
|
|
|
@ -199,6 +199,7 @@ if nm_debug
|
|||
'-Wno-missing-field-initializers',
|
||||
'-Wno-pragmas',
|
||||
'-Wno-sign-compare',
|
||||
'-Wno-tautological-constant-out-of-range-compare',
|
||||
'-Wno-unknown-pragmas',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wparentheses-equality',
|
||||
|
|
Loading…
Reference in a new issue