Bug 1498958 - Enable clang warnings: -Wtautological-unsigned-zero-compare, -Wtautological-unsigned-enum-zero-compare. r=glandium
authorChris Peterson <cpeterson@mozilla.com>
Tue, 16 Oct 2018 05:49:15 +0000
changeset 489959 46c013fd9f6a051e5bc47ddf1405b9564e907f59
parent 489958 59befcc4a2d6886d0d642710dd4b0ebc25a62082
child 489960 135512b63ffc0ba69ee632474f51a9223f8a802c
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersglandium
bugs1498958
milestone64.0a1
Bug 1498958 - Enable clang warnings: -Wtautological-unsigned-zero-compare, -Wtautological-unsigned-enum-zero-compare. r=glandium -Wtautological-unsigned-zero-compare: result of comparison of unsigned expression is always true/false https://clang.llvm.org/docs/DiagnosticsReference.html#wtautological-unsigned-zero-compare -Wtautological-unsigned-enum-zero-compare: result of comparison of unsigned enum expression is always true/false https://clang.llvm.org/docs/DiagnosticsReference.html#wtautological-unsigned-enum-zero-compare Differential Revision: https://phabricator.services.mozilla.com/D8688
build/moz.configure/warnings.configure
--- a/build/moz.configure/warnings.configure
+++ b/build/moz.configure/warnings.configure
@@ -82,18 +82,20 @@ check_and_add_gcc_warning('-Wimplicit-fa
 # --enable-warnings-as-errors is specified so that no unexpected fatal
 # warnings are produced.
 check_and_add_gcc_warning('-Werror=non-literal-null-conversion',
                           when='--enable-warnings-as-errors')
 
 # catches string literals used in boolean expressions
 check_and_add_gcc_warning('-Wstring-conversion')
 
-# catches overlapping range comparisons that are always true or false
+# catches comparisons that are always true or false
 check_and_add_gcc_warning('-Wtautological-overlap-compare')
+check_and_add_gcc_warning('-Wtautological-unsigned-enum-zero-compare')
+check_and_add_gcc_warning('-Wtautological-unsigned-zero-compare')
 
 # we inline 'new' and 'delete' in mozalloc
 check_and_add_gcc_warning('-Wno-inline-new-delete', cxx_compiler)
 
 # Prevent the following GCC warnings from being treated as errors:
 # too many false positives
 check_and_add_gcc_warning('-Wno-error=maybe-uninitialized')