New issue
Advanced search Search tips

Issue 865124 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Jul 19
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

attestation fails to build with clang >= r336610

Project Member Reported by manojgupta@chromium.org, Jul 18

Issue description

attestation-0.0.1-r2425: x86_64-cros-linux-gnu-clang++ -MMD -MF obj/attestation/server/server_library.attestation_service.o.d -DUSE_TPM2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Iobj/attestation/server_library.gen/include -Igen/include -I/build/snappy/tmp/portage/chromeos-base/attestation-0.0.1-r2425/work/attestation-0.0.1 -I/build/snappy/tmp/portage/chromeos-base/attestation-0.0.1-r2425/work/platform -I/build/snappy/usr/include -Igen -Wall -Wno-psabi -Wunused -Wno-unused-parameter -ggdb3 -fstack-protector-strong -Wformat=2 -fvisibility=internal -Wa,--noexecstack -Werror --sysroot=/build/snappy -DUSE_RTTI_FOR_TYPE_TAGS -Wno-c++11-extensions -Wno-unused-local-typedefs -DBASE_VER=395517 -pthread -I/build/snappy/usr/include/chromeos -I/build/snappy/usr/include/base-395517 -I/build/snappy/usr/include/glib-2.0 -I/build/snappy/usr/lib64/glib-2.0/include -I/build/snappy/usr/include/nss -I/build/snappy/usr/include/nspr -I/build/snappy/usr/include/dbus-1.0 -I/build/snappy/usr/lib64/dbus-1.0/include -fPIE -std=gnu++14 -DNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -pipe -O2 -pipe -O2 -pipe -march=corei7 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables  -c ../../../../../../../tmp/portage/chromeos-base/attestation-0.0.1-r2425/work/attestation-0.0.1/attestation/server/attestation_service.cc -o obj/attestation/server/server_library.attestation_service.o
attestation-0.0.1-r2425: ../../../../../../../tmp/portage/chromeos-base/attestation-0.0.1-r2425/work/attestation-0.0.1/attestation/server/attestation_service.cc:1651:25: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
attestation-0.0.1-r2425:   if (identity_features && IDENTITY_FEATURE_ENTERPRISE_ENROLLMENT_ID) {
attestation-0.0.1-r2425:                         ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attestation-0.0.1-r2425: ../../../../../../../tmp/portage/chromeos-base/attestation-0.0.1-r2425/work/attestation-0.0.1/attestation/server/attestation_service.cc:1651:25: note: use '&' for a bitwise operation
attestation-0.0.1-r2425:   if (identity_features && IDENTITY_FEATURE_ENTERPRISE_ENROLLMENT_ID) {
attestation-0.0.1-r2425:                         ^~
attestation-0.0.1-r2425:                         &
attestation-0.0.1-r2425: ../../../../../../../tmp/portage/chromeos-base/attestation-0.0.1-r2425/work/attestation-0.0.1/attestation/server/attestation_service.cc:1651:25: note: remove constant to silence this warning
attestation-0.0.1-r2425:   if (identity_features && IDENTITY_FEATURE_ENTERPRISE_ENROLLMENT_ID) {
attestation-0.0.1-r2425:                        ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attestation-0.0.1-r2425: 1 error generated.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/a900999ca8110b13822a8c3b262e6d18f4a8628d

commit a900999ca8110b13822a8c3b262e6d18f4a8628d
Author: Manoj Gupta <manojgupta@google.com>
Date: Thu Jul 19 04:59:02 2018

attestation: Fix an error reported by clang.

The use of '&&' does seem to be an error here.
Replaced by a '&' which seems to be case for other uses as well.
Fixes error: use of logical '&&' with constant operand
 [-Werror,-Wconstant-logical-operand]

BUG= chromium:865124 
TEST=No more clang error.

Change-Id: I618debd78c3323674ed3e5cb58f07c7a46208fff
Reviewed-on: https://chromium-review.googlesource.com/1142388
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Yves Arrouye <drcrash@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/a900999ca8110b13822a8c3b262e6d18f4a8628d/attestation/server/attestation_service.cc

Status: Verified (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/42812938b92d636b62bbfd9b40882025c27787f5

commit 42812938b92d636b62bbfd9b40882025c27787f5
Author: Yves Arrouye <drcrash@google.com>
Date: Fri Jul 20 18:41:10 2018

cryptohome: Fix an error that will be reported by clang.

The use of '&&' is an error here.

Fixes error: use of logical '&&' with constant operand
 [-Werror,-Wconstant-logical-operand]

See CL:1142388 for the first detection by clang.

BUG= chromium:865124 
TEST=No more clang error.

Change-Id: I2cea538a12b3f7338f4e8fc5a135f3b82d5250ba
Reviewed-on: https://chromium-review.googlesource.com/1142394
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Yves Arrouye <drcrash@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/42812938b92d636b62bbfd9b40882025c27787f5/cryptohome/attestation.cc

Sign in to add a comment