Bug 1483761 - Enable clang's -Wtautological-overlap-compare warning. r=glandium

-Wtautological-overlap-compare is an opt-in warning added in clang 3.5. It warns about overlapping comparisons that are always true or false, such as:

if (x > 4 || x < 10) {} // warning! always true
int b = x < 2 && x > 5; // warning! always false
return x > 4 || x < 10; // warning! always true

https://clang.llvm.org/docs/DiagnosticsReference.html#wtautological-overlap-compare

There are currently no -Wtautological-overlap-compare warnings in mozilla-central.

Differential Revision: https://phabricator.services.mozilla.com/D3477

--HG--
extra : rebase_source : e6aa211a338633e5fb7507b3a8f341709d72d6c9
This commit is contained in:
Chris Peterson 2018-08-14 22:39:03 -07:00
Родитель 8cddf640b9
Коммит 1f8394cea3
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -87,6 +87,9 @@ check_and_add_gcc_warning('-Werror=non-literal-null-conversion',
# catches string literals used in boolean expressions
check_and_add_gcc_warning('-Wstring-conversion')
# catches overlapping range comparisons that are always true or false
check_and_add_gcc_warning('-Wtautological-overlap-compare')
# we inline 'new' and 'delete' in mozalloc
check_and_add_gcc_warning('-Wno-inline-new-delete', cxx_compiler)