New issue
Advanced search Search tips

Issue 637306 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 619640
Owner:
Closed: Aug 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

New warning with ToT Clang: -Waddress-of-packed-member

Project Member Reported by h...@chromium.org, Aug 12 2016

Issue description

For example, from https://build.chromium.org/p/chromium.fyi/builders/ClangToTLinux/builds/6009/steps/compile/logs/stdio:

FAILED: obj/third_party/usrsctp/usrsctp/sctp_input.o 
../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/usrsctp/usrsctp/sctp_input.o.d -DSCTP_PROCESS_LEVEL_LOCKS -DSCTP_SIMPLE_ALLOCATOR -DSCTP_USE_OPENSSL_SHA1 -D__Userspace__ -D__Userspace_os_Linux -D_GNU_SOURCE -DNON_WINDOWS_DEFINE -DV8_DEPRECATION_WARNINGS -DENABLE_MDNS=1 -DENABLE_NOTIFICATIONS -DENABLE_PEPPER_CDMS -DENABLE_PLUGINS=1 -DENABLE_PDF=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUSE_UDEV -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_CLIPBOARD_AURAX11=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DENABLE_WEBRTC=1 -DENABLE_EXTENSIONS=1 -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=278510 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCOMPONENT_BUILD -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBORINGSSL_SHARED_LIBRARY -I../.. -Igen -I../../third_party/usrsctp/usrsctplib/usrsctplib -I../../third_party/usrsctp/usrsctplib/usrsctplib/netinet -I../../third_party/boringssl/src/include -UINET -UINET6 -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -fcolor-diagnostics -fdebug-prefix-map=/b/c/b/ClangToTLinux/src=. -pthread -m64 -march=x86-64 -O2 -fno-ident -fdata-sections -ffunction-sections -g2 --sysroot=../../build/linux/debian_wheezy_amd64-sysroot -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Werror -Wall -Wno-unused-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-incompatible-pointer-types -Wno-unused-function  -c ../../third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c -o obj/third_party/usrsctp/usrsctp/sctp_input.o
../../third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c:1734:15: error: taking address of packed member 'time_entered' of class or structure 'sctp_state_cookie' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
                                                              &cookie->time_entered,
                                                               ^~~~~~~~~~~~~~~~~~~~
../../third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c:2486:10: error: taking address of packed member 'time_entered' of class or structure 'sctp_state_cookie' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
                                                  &cookie->time_entered, sctp_align_unsafe_makecopy,
                                                   ^~~~~~~~~~~~~~~~~~~~
2 errors generated.


The warning was reviewed in http://reviews.llvm.org/D20561 and landed in r278483.


I'll prepare a patch to disable it for now.
 

Comment 1 by r...@chromium.org, Aug 12 2016

This warning landed upstream twice and was quickly reverted. Are we sure it's going to stay?

Comment 2 by h...@chromium.org, Aug 12 2016

No, but let's disable it while it's in: https://codereview.chromium.org/2238303002/

It's easy to revert the suppression if it's reverted in Clang.
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 12 2016

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

commit 248f30849f0bb43a94845287020926765340dab5
Author: Hans Wennborg <hans@chromium.org>
Date: Fri Aug 12 18:31:35 2016

Suppress new Clang warning: -Waddress-of-packed-member

BUG= 637306 
TBR=thakis

Review URL: https://codereview.chromium.org/2238303002 .

Cr-Commit-Position: refs/heads/master@{#411715}

[modify] https://crrev.com/248f30849f0bb43a94845287020926765340dab5/build/config/compiler/BUILD.gn

Comment 4 by r...@chromium.org, Aug 16 2016

Mergedinto: 619640
Status: Duplicate (was: Assigned)

Sign in to add a comment