clang tot bots red with -Wtautological-unsigned-zero-compare |
||
Issue descriptionFor example, from https://build.chromium.org/p/chromium.fyi/builders/ClangToTLinux/builds/9021 FAILED: obj/third_party/ced/ced/compact_enc_det_hint_code.o ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/ced/ced/compact_enc_det_hint_code.o.d -DCOMPILER_GCC -DHTML5_MODE -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=\"312792\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCOMPONENT_BUILD -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Igen -I../../third_party/ced/src -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -m64 -march=x86-64 -O2 -fno-ident -fdata-sections -ffunction-sections -fomit-frame-pointer -g2 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -Wno-unused-function -std=gnu++14 -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_jessie_amd64-sysroot -fno-exceptions -fvisibility-inlines-hidden -c ../../third_party/ced/src/compact_enc_det/compact_enc_det_hint_code.cc -o obj/third_party/ced/ced/compact_enc_det_hint_code.o ../../third_party/ced/src/compact_enc_det/compact_enc_det_hint_code.cc:85:11: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-zero-compare] if (enc < 0) { ~~~ ^ ~ 1 error generated. [5070/47498] CC obj/third_party/brotli/brotli/static_dict.o [5071/47498] CXX obj/third_party/boringssl/boringssl_fuzzer_no_fuzzer_mode/t1_lib.o [5072/47498] CC obj/third_party/brotli/brotli/compress_fragment.o [5073/47498] CXX obj/third_party/ced/ced/encodings.o FAILED: obj/third_party/ced/ced/encodings.o ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/ced/ced/encodings.o.d -DCOMPILER_GCC -DHTML5_MODE -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=\"312792\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCOMPONENT_BUILD -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Igen -I../../third_party/ced/src -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -m64 -march=x86-64 -O2 -fno-ident -fdata-sections -ffunction-sections -fomit-frame-pointer -g2 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -Wno-unused-function -std=gnu++14 -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_jessie_amd64-sysroot -fno-exceptions -fvisibility-inlines-hidden -c ../../third_party/ced/src/util/encodings/encodings.cc -o obj/third_party/ced/ced/encodings.o ../../third_party/ced/src/util/encodings/encodings.cc:257:16: error: comparison of unsigned enum expression >= 0 is always true [-Werror,-Wtautological-unsigned-zero-compare] return ((enc >= 0) && (enc < kNumEncodings)); ~~~ ^ ~ ../../third_party/ced/src/util/encodings/encodings.cc:502:13: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-zero-compare] if ( (enc < 0) || (enc >= kNumEncodings) ) ~~~ ^ ~ ../../third_party/ced/src/util/encodings/encodings.cc:511:13: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-zero-compare] if ( (enc < 0) || (enc >= kNumEncodings) ) ~~~ ^ ~ 3 errors generated. [5074/47498] CXX obj/third_party/ced/ced/compact_enc_det.o FAILED: obj/third_party/ced/ced/compact_enc_det.o ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/ced/ced/compact_enc_det.o.d -DCOMPILER_GCC -DHTML5_MODE -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=\"312792\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCOMPONENT_BUILD -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Igen -I../../third_party/ced/src -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -m64 -march=x86-64 -O2 -fno-ident -fdata-sections -ffunction-sections -fomit-frame-pointer -g2 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -Wno-unused-function -std=gnu++14 -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_jessie_amd64-sysroot -fno-exceptions -fvisibility-inlines-hidden -c ../../third_party/ced/src/compact_enc_det/compact_enc_det.cc -o obj/third_party/ced/ced/compact_enc_det.o ../../third_party/ced/src/compact_enc_det/compact_enc_det.cc:4635:11: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-zero-compare] if (enc < 0) {return false;} ~~~ ^ ~ ../../third_party/ced/src/compact_enc_det/compact_enc_det.cc:4637:12: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-zero-compare] if (enc2 < 0) {return false;} ~~~~ ^ ~ 2 errors generated.
,
Sep 8 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/80fc58314493de52acff5b8535c86ccef0a5511a commit 80fc58314493de52acff5b8535c86ccef0a5511a Author: Hans Wennborg <hans@chromium.org> Date: Fri Sep 08 16:09:55 2017 Suppress new Clang warning -Wtautological-unsigned-zero-compare The new warning landed in Clang r312792. TBR=thakis,rnk Bug: 763392 Change-Id: I4be7d295e5e20186be6de13a478355aba7c0abf1 Reviewed-on: https://chromium-review.googlesource.com/657900 Reviewed-by: Hans Wennborg <hans@chromium.org> Commit-Queue: Hans Wennborg <hans@chromium.org> Cr-Commit-Position: refs/heads/master@{#500603} [modify] https://crrev.com/80fc58314493de52acff5b8535c86ccef0a5511a/build/config/compiler/BUILD.gn
,
Feb 15 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c520a7b38d7781e13564a4559e41f9c9c47f51b3 commit c520a7b38d7781e13564a4559e41f9c9c47f51b3 Author: Nico Weber <thakis@chromium.org> Date: Thu Feb 15 19:28:04 2018 Stop disabling warnings that are now off-by-default in clang. Namely, Wtautological-unsigned-zero-compare and Wtautological-unsigned-enum-zero-compare, see http://llvm.org/viewvc/llvm-project?view=revision&revision=322901 If we have to disable them again in the future, it's probably better to use -Wno-tautological-in-range-compare then. Bug: 763392 , 767059 Change-Id: I8374fc2b9854618052b784be0371f8744b057701 Reviewed-on: https://chromium-review.googlesource.com/922022 Reviewed-by: Hans Wennborg <hans@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/master@{#537098} [modify] https://crrev.com/c520a7b38d7781e13564a4559e41f9c9c47f51b3/build/config/compiler/BUILD.gn
,
Feb 15 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by h...@chromium.org
, Sep 8 2017