ClangToT failing with -Wtautological-unsigned-enum-zero-compare |
|||||||
Issue descriptionThis is due to r313745 From https://build.chromium.org/p/chromium.fyi/builders/ClangToTLinux/builds/9132 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=\"313756\" -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 -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=1 -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-tautological-unsigned-zero-compare -Wno-null-pointer-arithmetic -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-enum-zero-compare] if (enc < 0) { ~~~ ^ ~ 1 error generated. [44/35891] LINK ./boringssl_cert_fuzzer [45/35891] LINK ./boringssl_client_fuzzer [46/35891] LINK ./boringssl_dtls_client_fuzzer [47/35891] LINK ./boringssl_spki_fuzzer [48/35891] LINK ./boringssl_session_fuzzer [49/35891] LINK ./boringssl_ssl_ctx_api_fuzzer [50/35891] SOLINK ./libVkLayer_core_validation.so [51/35891] ACTION //remoting/webapp:credits(//build/toolchain/linux:clang_x64) [52/35890] CXX obj/components/version_info/version_info/version_info.o [53/35890] ACTION //components/resources:about_credits(//build/toolchain/linux:clang_x64) [54/35889] ACTION //remoting/host/installer:credits(//build/toolchain/linux:clang_x64) [55/35888] 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=\"313756\" -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 -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=1 -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-tautological-unsigned-zero-compare -Wno-null-pointer-arithmetic -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-enum-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-enum-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-enum-zero-compare] if ( (enc < 0) || (enc >= kNumEncodings) ) ~~~ ^ ~ 3 errors generated.
,
Sep 20 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f4ac2785e42132e32c6737b7b39d40ce68f20c5c commit f4ac2785e42132e32c6737b7b39d40ce68f20c5c Author: Hans Wennborg <hans@chromium.org> Date: Wed Sep 20 15:54:46 2017 Clang: Disable new -Wtautological-unsigned-enum-zero-compare warning TBR=rnk Bug: 767059 Change-Id: I52b7fd023c6bad1dd507b23445d95aa8848d5e70 Reviewed-on: https://chromium-review.googlesource.com/675383 Reviewed-by: Hans Wennborg <hans@chromium.org> Commit-Queue: Hans Wennborg <hans@chromium.org> Cr-Commit-Position: refs/heads/master@{#503162} [modify] https://crrev.com/f4ac2785e42132e32c6737b7b39d40ce68f20c5c/build/config/compiler/BUILD.gn
,
Sep 20 2017
,
Sep 20 2017
,
Sep 22 2017
Issue 767125 has been merged into this issue.
,
Oct 12 2017
In the same vein, from r315614: 97/50566] CXX obj/base/base/memory_mapped_file_posix.o FAILED: obj/base/base/memory_mapped_file_posix.o ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/base/base/memory_mapped_file_posix.o.d -DUSE_SYMBOLIZE -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=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 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCR_CLANG_REVISION=\"315623\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCOMPONENT_BUILD -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBASE_IMPLEMENTATION -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -I../.. -Igen -I../../build/linux/debian_jessie_amd64-sysroot/usr/include/glib-2.0 -I../../build/linux/debian_jessie_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -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 -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=1 -no-canonical-prefixes -m64 -march=x86-64 -Wall -Werror -Wextra -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-tautological-unsigned-zero-compare -Wno-null-pointer-arithmetic -Wno-tautological-unsigned-enum-zero-compare -fomit-frame-pointer -g2 -ggnu-pubnames -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-char-subscripts -Wexit-time-destructors -Wexit-time-destructors -O2 -fno-ident -fdata-sections -ffunction-sections -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 ../../base/files/memory_mapped_file_posix.cc -o obj/base/base/memory_mapped_file_posix.o ../../base/files/memory_mapped_file_posix.cc:60:23: error: comparison 'int64_t' (aka 'long') > 9223372036854775807 is always false [-Werror,-Wtautological-constant-compare] aligned_start > std::numeric_limits<off_t>::max() || ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../base/files/memory_mapped_file_posix.cc:61:45: error: comparison 'uint64_t' (aka 'unsigned long') > 18446744073709551615 is always false [-Werror,-Wtautological-constant-compare] static_cast<uint64_t>(aligned_size) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ../../base/files/memory_mapped_file_posix.cc:63:44: error: comparison 'uint64_t' (aka 'unsigned long') > 18446744073709551615 is always false [-Werror,-Wtautological-constant-compare] static_cast<uint64_t>(region.size) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ 3 errors generated.
,
Oct 12 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cfa6d963eb8a607c9885af92d43f74c61866a4d2 commit cfa6d963eb8a607c9885af92d43f74c61866a4d2 Author: Hans Wennborg <hans@chromium.org> Date: Thu Oct 12 22:10:02 2017 Clang: disable new warning -Wtautological-constant-compare This is a new warning in Clang r315614 and fires on e.g.: int64_t aligned_start = 0; int64_t aligned_size = 0; CalculateVMAlignedBoundaries(region.offset, region.size, &aligned_start, &aligned_size, &data_offset); // Ensure that the casts in the mmap call below are sane. if (aligned_start < 0 || aligned_size < 0 || aligned_start > std::numeric_limits<off_t>::max() || static_cast<uint64_t>(aligned_size) > std::numeric_limits<size_t>::max() || static_cast<uint64_t>(region.size) > std::numeric_limits<size_t>::max()) { DLOG(ERROR) << "Region bounds are not valid for mmap"; return false; } TBR=thakis Bug: 767059 Change-Id: I659664af603677195ba41d22de1098ca5084045b Reviewed-on: https://chromium-review.googlesource.com/716875 Reviewed-by: Hans Wennborg <hans@chromium.org> Commit-Queue: Hans Wennborg <hans@chromium.org> Cr-Commit-Position: refs/heads/master@{#508497} [modify] https://crrev.com/cfa6d963eb8a607c9885af92d43f74c61866a4d2/build/config/compiler/BUILD.gn
,
Oct 12 2017
Probably should keep this open to decide if we want this warning, and if so, for the cleanup.
,
Oct 12 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/26f095479802c277dbd8b2524cd1a27555fc714c commit 26f095479802c277dbd8b2524cd1a27555fc714c Author: Nico Weber <thakis@chromium.org> Date: Thu Oct 12 22:44:03 2017 Revert "Clang: disable new warning -Wtautological-constant-compare" This reverts commit cfa6d963eb8a607c9885af92d43f74c61866a4d2. Reason for revert: was reverted again upstream Original change's description: > Clang: disable new warning -Wtautological-constant-compare > > This is a new warning in Clang r315614 and fires on e.g.: > > int64_t aligned_start = 0; > int64_t aligned_size = 0; > CalculateVMAlignedBoundaries(region.offset, > region.size, > &aligned_start, > &aligned_size, > &data_offset); > > // Ensure that the casts in the mmap call below are sane. > if (aligned_start < 0 || aligned_size < 0 || > aligned_start > std::numeric_limits<off_t>::max() || > static_cast<uint64_t>(aligned_size) > > std::numeric_limits<size_t>::max() || > static_cast<uint64_t>(region.size) > > std::numeric_limits<size_t>::max()) { > DLOG(ERROR) << "Region bounds are not valid for mmap"; > return false; > } > > TBR=thakis > > Bug: 767059 > Change-Id: I659664af603677195ba41d22de1098ca5084045b > Reviewed-on: https://chromium-review.googlesource.com/716875 > Reviewed-by: Hans Wennborg <hans@chromium.org> > Commit-Queue: Hans Wennborg <hans@chromium.org> > Cr-Commit-Position: refs/heads/master@{#508497} TBR=thakis@chromium.org,hans@chromium.org Change-Id: I8d2a4ecfc2d0d74ff700d3c6ec82b49ec5639641 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 767059 Reviewed-on: https://chromium-review.googlesource.com/716463 Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/master@{#508511} [modify] https://crrev.com/26f095479802c277dbd8b2524cd1a27555fc714c/build/config/compiler/BUILD.gn
,
Oct 15 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7360486c5ff6b2659fd13eef5d366c1e4e86dc98 commit 7360486c5ff6b2659fd13eef5d366c1e4e86dc98 Author: Nico Weber <thakis@chromium.org> Date: Sun Oct 15 20:32:18 2017 Revert "Revert "Clang: disable new warning -Wtautological-constant-compare"" This reverts commit 26f095479802c277dbd8b2524cd1a27555fc714c. Reason for revert: warning landed again Original change's description: > Revert "Clang: disable new warning -Wtautological-constant-compare" > > This reverts commit cfa6d963eb8a607c9885af92d43f74c61866a4d2. > > Reason for revert: was reverted again upstream > > Original change's description: > > Clang: disable new warning -Wtautological-constant-compare > > > > This is a new warning in Clang r315614 and fires on e.g.: > > > > int64_t aligned_start = 0; > > int64_t aligned_size = 0; > > CalculateVMAlignedBoundaries(region.offset, > > region.size, > > &aligned_start, > > &aligned_size, > > &data_offset); > > > > // Ensure that the casts in the mmap call below are sane. > > if (aligned_start < 0 || aligned_size < 0 || > > aligned_start > std::numeric_limits<off_t>::max() || > > static_cast<uint64_t>(aligned_size) > > > std::numeric_limits<size_t>::max() || > > static_cast<uint64_t>(region.size) > > > std::numeric_limits<size_t>::max()) { > > DLOG(ERROR) << "Region bounds are not valid for mmap"; > > return false; > > } > > > > TBR=thakis > > > > Bug: 767059 > > Change-Id: I659664af603677195ba41d22de1098ca5084045b > > Reviewed-on: https://chromium-review.googlesource.com/716875 > > Reviewed-by: Hans Wennborg <hans@chromium.org> > > Commit-Queue: Hans Wennborg <hans@chromium.org> > > Cr-Commit-Position: refs/heads/master@{#508497} > > TBR=thakis@chromium.org,hans@chromium.org > > Change-Id: I8d2a4ecfc2d0d74ff700d3c6ec82b49ec5639641 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 767059 > Reviewed-on: https://chromium-review.googlesource.com/716463 > Reviewed-by: Nico Weber <thakis@chromium.org> > Commit-Queue: Nico Weber <thakis@chromium.org> > Cr-Commit-Position: refs/heads/master@{#508511} TBR=thakis@chromium.org,hans@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 767059 Change-Id: I8c89bac3795c7136f2ceaaf591b23a1dc767f4c8 Reviewed-on: https://chromium-review.googlesource.com/719944 Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/master@{#508959} [modify] https://crrev.com/7360486c5ff6b2659fd13eef5d366c1e4e86dc98/build/config/compiler/BUILD.gn
,
Nov 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e83806f7408da1ea396f2eeae5da32905142d438 commit e83806f7408da1ea396f2eeae5da32905142d438 Author: Hans Wennborg <hans@chromium.org> Date: Fri Nov 10 23:20:59 2017 Clang: re-enable -Wtautological-constant-out-of-range-compare It was unintentionally disabled as part of disabling the new Clang warning -Wtautological-constant-compare. Bug: 767059 , 783204 Change-Id: I621f002f319cb395ecc30ca7ff9f132cefe0e5d4 Reviewed-on: https://chromium-review.googlesource.com/764035 Commit-Queue: Hans Wennborg <hans@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: John Budorick <jbudorick@chromium.org> Cr-Commit-Position: refs/heads/master@{#515739} [modify] https://crrev.com/e83806f7408da1ea396f2eeae5da32905142d438/build/config/compiler/BUILD.gn
,
Dec 5 2017
The following revision refers to this bug: https://boringssl.googlesource.com/boringssl/+/6979c7e8eb0c96cbf57bd8f657d59a50f0487fcf commit 6979c7e8eb0c96cbf57bd8f657d59a50f0487fcf Author: David Benjamin <davidben@google.com> Date: Tue Dec 05 19:34:47 2017 Disable Clang -Wtautological-constant-compare. This is a recent Clang warning, but it's far too aggressive. The earlier unsigned long silliness was worth fixing, but it otherwise complains on 32-bit platforms with: if (some_size_t > 0xffffffff) { ... } which is unreasonable as, on 64-bit platforms, this check is meaningful and requiring the programmer add ifdefs is error-prone. This matches Chromium in https://crbug.com/767059 . Bug: chromium:767059 Change-Id: I0bb0f3a4b60f222e9d1b3c569471fbcf5518caed Reviewed-on: https://boringssl-review.googlesource.com/23845 Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Adam Langley <agl@google.com> [modify] https://crrev.com/6979c7e8eb0c96cbf57bd8f657d59a50f0487fcf/CMakeLists.txt
,
Jan 3 2018
error: unknown warning option '-Wno-tautological-constant-compare'; did you mean '-Wno-tautological-pointer-compare'? [-Werror,-Wunknown-warning-option] This option isnt understood on clang for linux? I'm seeing it in 2 build files build/config/compiler/BUILD.gn and third_party/libxml/BUILD.gn
,
Jan 3 2018
,
Jan 3 2018
fbarchard: Which Clang for Linux? It's understood by the version Chromium uses.
,
Jan 3 2018
I seem to still have an old version. The roll script for libyuv says it should update chromium deps and clang Clang version changed 313786:318667 Details: https://chromium.googlesource.com/chromium/src/+/ff3b31782d..e6bcf53038/tools/clang/scripts/update.py This is the versoin third_party/llvm-build/Release+Asserts/bin/clang++ --version clang version 6.0.0 (trunk 313786) Target: x86_64-unknown-linux-gnu Thread model: posix But chromium has a newer version: third_party/llvm-build/Release+Asserts/bin/clang++ --version clang version 6.0.0 (trunk 321204) Target: x86_64-unknown-linux-gnu Thread model: posix tools/clang/scripts/update.py Updating Clang to 313786-1... Clang is already up to date.
,
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 20 2017