New issue
Advanced search Search tips

Issue 857393 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Clang ToT builds failing with new warning: -Wconstant-logical-operand

Project Member Reported by h...@chromium.org, Jun 28 2018

Issue description

Example build: https://ci.chromium.org/buildbot/chromium.clang/ToTLinux/2932

FAILED: obj/components/error_page/common/common/localized_error.o 
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/components/error_page/common/common/localized_error.o.d -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=\"335814\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCOMPONENT_BUILD -DCR_LIBCXX_REVISION=332543 -DCR_LIBCXXABI_REVISION=331450 -DCR_SYSROOT_HASH=4e7db513b0faeea8fb410f70c9909e8736f5c0ab -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -DWEBP_EXTERN=extern -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DPROTOBUF_USE_DLLS -DBORINGSSL_SHARED_LIBRARY -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSKIA_DLL -DGR_GL_IGNORE_ES3_MSAA=0 -DSKCMS_API=__attribute__\(\(visibility\(\"default\"\)\)\) -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_NO_PROTOTYPES -I../.. -Igen -I../../third_party/libwebp/src -I../../third_party/ced/src -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/protobuf/src -I../../third_party/boringssl/src/include -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/encode -I../../third_party/skia/include/gpu -I../../third_party/skia/include/images -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/vulkan/include -I../../third_party/skia/third_party/vulkanmemoryallocator -I../../third_party/skia/src/gpu -I../../third_party/skia/src/sksl -I../../third_party/vulkan/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -fmerge-all-constants -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -no-canonical-prefixes -fcomplete-member-pointers -m64 -march=x86-64 -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-address-of-packed-member -Wno-nonportable-include-path -Wno-user-defined-warnings -Wno-unused-lambda-capture -Wno-null-pointer-arithmetic -Wno-enum-compare-switch -Wno-ignored-pragma-optimize -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g2 -ggnu-pubnames -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wno-header-guard -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/nss -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/nspr -std=gnu++14 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_sid_amd64-sysroot -fvisibility-inlines-hidden -c ../../components/error_page/common/localized_error.cc -o obj/components/error_page/common/common/localized_error.o
../../components/error_page/common/localized_error.cc:975:49: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
    params->suggest_reload = !!(options.buttons && SHOW_BUTTON_RELOAD);
                                                ^  ~~~~~~~~~~~~~~~~~~
../../components/error_page/common/localized_error.cc:975:49: note: use '&' for a bitwise operation
    params->suggest_reload = !!(options.buttons && SHOW_BUTTON_RELOAD);
                                                ^~
                                                &
../../components/error_page/common/localized_error.cc:975:49: note: remove constant to silence this warning
    params->suggest_reload = !!(options.buttons && SHOW_BUTTON_RELOAD);
                                               ~^~~~~~~~~~~~~~~~~~~~~
1 error generated.


The warning looks valid here; I'll try to fix.

It's not a new warning flag, so I wonder what changed.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7ea9a73f82a0271bc542e85805441ae7452f2812

commit 7ea9a73f82a0271bc542e85805441ae7452f2812
Author: Hans Wennborg <hans@chromium.org>
Date: Thu Jun 28 12:25:19 2018

Fix two new -Wconstant-logical-operand warnings

A new Clang version caught these two cases.

(While fixing localized_error.cc, switch the bitfields to unsigned and
tweak a comment.)

TBR=edwardjung,khushalsagar

Bug:  857393 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I88bf4bfb2f3cf7874c308c9b3453e9d01c7c16ee
Reviewed-on: https://chromium-review.googlesource.com/1118165
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571091}
[modify] https://crrev.com/7ea9a73f82a0271bc542e85805441ae7452f2812/components/error_page/common/localized_error.cc
[modify] https://crrev.com/7ea9a73f82a0271bc542e85805441ae7452f2812/gpu/command_buffer/service/service_font_manager.cc

Comment 2 by h...@chromium.org, Jun 28 2018

Status: Started (was: Assigned)
After https://chromium-review.googlesource.com/c/chromium/src/+/1118380, I can get through a full debug build on Linux
Project Member

Comment 3 by bugdroid1@chromium.org, Jun 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9b83e9c749b4cda29a11330f585aa07fc06e98dd

commit 9b83e9c749b4cda29a11330f585aa07fc06e98dd
Author: Hans Wennborg <hans@chromium.org>
Date: Thu Jun 28 14:47:58 2018

Fix a new -Wconstant-logical-operand warning

A new Clang version caught this.

TBR=wangxianzhu

Bug:  857393 
Change-Id: Ib3d9d7c0bd67d9b2deed699662de91e75ee47694
Reviewed-on: https://chromium-review.googlesource.com/1118380
Reviewed-by: Hans Wennborg <hans@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571121}
[modify] https://crrev.com/9b83e9c749b4cda29a11330f585aa07fc06e98dd/third_party/blink/renderer/core/layout/visual_rect_mapping_test.cc

Comment 4 by h...@chromium.org, Jun 28 2018

The Clang change that caused this was r335781.
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8e2be8dfc77787d45ab56211c0e119cbaabede9c

commit 8e2be8dfc77787d45ab56211c0e119cbaabede9c
Author: Nico Weber <thakis@chromium.org>
Date: Thu Jun 28 22:55:30 2018

Fix a new -Wconstant-logical-operand warning.

Bug:  857393 
Change-Id: Ib852b5824b27443f7e1f5176646588fcbef195ed
Reviewed-on: https://chromium-review.googlesource.com/1118857
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571312}
[modify] https://crrev.com/8e2be8dfc77787d45ab56211c0e119cbaabede9c/media/capture/video/win/video_capture_device_win.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0107b1058f35a71e2d90cd9be686e82bc36d8c47

commit 0107b1058f35a71e2d90cd9be686e82bc36d8c47
Author: Nico Weber <thakis@chromium.org>
Date: Fri Jun 29 11:52:36 2018

Roll clang 335608:335864.

Ran `tools/clang/scripts/upload_revision.py 335864`.

Contains two notable changes:
- lld now increases section layout to 16 bytes for sections that
  are CFG targets, which makes CFG more precise on x86 and
  works around a crash bug in Microsoft's x86 emulator on arm.
- Wconstant-logical-operand now fires more often and finds more bugs.
  We fixed all new instances of this warning on all bots we know about.

Bug:  857012 , 857393 
Change-Id: I9396f5bae9750a1abcb9f0b256e9caed7b6ccc71
Reviewed-on: https://chromium-review.googlesource.com/1118531
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571444}
[modify] https://crrev.com/0107b1058f35a71e2d90cd9be686e82bc36d8c47/tools/clang/scripts/update.py

Comment 7 by h...@chromium.org, Jun 29 2018

Status: Fixed (was: Started)
Seems fixed.

Sign in to add a comment