New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 665647 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Nov 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

adhd does not build with latest llvm

Project Member Reported by manojgupta@chromium.org, Nov 15 2016

Issue description

Latest clang flags error when address of a member in packed structure is taken and is possibly unaligned.

libcras/cras_client.c:1349:41: error: taking address of packed member 'update_count' of class or structure 'cras_server_state' may result in an
unaligned pointer value [-Werror,-Waddress-of-packed-member]

 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/adhd/+/ce10c9ea50d65a1929c8886b00e79217ee5f1a2a

commit ce10c9ea50d65a1929c8886b00e79217ee5f1a2a
Author: Manoj Gupta <manojgupta@google.com>
Date: Mon Nov 14 21:27:43 2016

Fix adhd to build with latest llvm.

Fix clang error taking address of packed member 'update_count'
of class or structure 'cras_server_state' may result in an
unaligned pointer value [-Werror,-Waddress-of-packed-member]

BUG= chromium:665647 
TEST=adhd now builds with clang
Change-Id: Iebe113619a1b3ad59c189113ec4a53b9a5c430a2
Reviewed-on: https://chromium-review.googlesource.com/411960
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/ce10c9ea50d65a1929c8886b00e79217ee5f1a2a/cras/src/libcras/cras_client.c
[modify] https://crrev.com/ce10c9ea50d65a1929c8886b00e79217ee5f1a2a/cras/src/common/cras_types.h
[modify] https://crrev.com/ce10c9ea50d65a1929c8886b00e79217ee5f1a2a/cras/src/server/cras_system_state.c

Project Member

Comment 2 by bugdroid1@chromium.org, Nov 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/adhd/+/28b9838811438097f3cf4445cb71b633868746e1

commit 28b9838811438097f3cf4445cb71b633868746e1
Author: Manoj Gupta <manojgupta@google.com>
Date: Fri Nov 18 23:12:17 2016

Fix adhd to build with latest llvm.

Clang bug https://llvm.org/bugs/show_bug.cgi?id=31050 is fixed.

So remove some unnecessary pointer casts that had to be added to
avoid the following warning from clang.

clang error taking address of packed member 'update_count'
of class or structure 'cras_server_state' may result in an
unaligned pointer value [-Werror,-Waddress-of-packed-member]

BUG= chromium:665647 
TEST=adhd now builds with clang

Change-Id: If7e09a133c4d41f9a8197b435687fd8cb756b58a
Reviewed-on: https://chromium-review.googlesource.com/413052
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>

[modify] https://crrev.com/28b9838811438097f3cf4445cb71b633868746e1/cras/src/libcras/cras_client.c
[modify] https://crrev.com/28b9838811438097f3cf4445cb71b633868746e1/cras/src/server/cras_system_state.c

Status: Fixed (was: Assigned)

Comment 4 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58
Status: Verified (was: Fixed)

Sign in to add a comment