David Ribeiro Alves has submitted this change and it was merged.

Change subject: Silence clang -Waddress-of-packed-member warning
......................................................................


Silence clang -Waddress-of-packed-member warning

macOS/clang 4.0 builds have become polluted with warnings like:

In file included from ../../src/kudu/tablet/deltamemstore.cc:22:
In file included from ../../src/kudu/tablet/deltafile.h:34:
In file included from ../../src/kudu/tablet/deltamemstore.h:33:
../../src/kudu/tablet/concurrent_btree.h:386:33: warning: taking address of 
packed member 'version_' of class or structure 
'kudu::tablet::btree::NodeBase<kudu::tablet::DMSTreeTraits>' may result in an 
unaligned pointer value [-Waddress-of-packed-member]
    VersionField::SetInserting(&version_);
                                ^~~~~~~~
../../src/kudu/tablet/concurrent_btree.h:721:11: note: in instantiation of 
member function 
'kudu::tablet::btree::NodeBase<kudu::tablet::DMSTreeTraits>::SetInserting' 
requested here
    this->SetInserting();
          ^
../../src/kudu/tablet/concurrent_btree.h:707:12: note: in instantiation of 
member function 
'kudu::tablet::btree::LeafNode<kudu::tablet::DMSTreeTraits>::InsertNew' 
requested here
    return InsertNew(mut->idx(), mut->key(), val, mut->arena());
           ^
../../src/kudu/tablet/concurrent_btree.h:1316:19: note: in instantiation of 
member function 
'kudu::tablet::btree::LeafNode<kudu::tablet::DMSTreeTraits>::Insert' requested 
here
    switch (node->Insert(mutation, val)) {
                  ^
../../src/kudu/tablet/concurrent_btree.h:869:19: note: in instantiation of 
member function 
'kudu::tablet::btree::CBTree<kudu::tablet::DMSTreeTraits>::Insert' requested 
here
    return tree_->Insert(this, val);
                  ^
../../src/kudu/tablet/deltamemstore.cc:103:31: note: in instantiation of member 
function 
'kudu::tablet::btree::PreparedMutation<kudu::tablet::DMSTreeTraits>::Insert' 
requested here
  if (PREDICT_FALSE(!mutation.Insert(update.slice()))) {

This is because of clang's -Waddress-of-packed-member warning which has
been committed and reverted and committed again in the clang codebase.

Chromium also silenced this (multiple times), see:
https://bugs.chromium.org/p/chromium/issues/detail?id=637306

This patch makes clang ignore that warning, but if we just left it
at that older versions of clang would then complain about the unknown
warning, so this also makes clang ignore unknown warnings. The
alternative would be have clang ignore the warning only for
certain versions, but then we'd have to do that separately for macOS
and linux which seems more code to add and maintain.

Note that this warning can't be ignored locally, with pragmas, because
then GCC would spew warnings about unknown pragmas. Moreover the GCC
warnings themselves can't be ignored because of a long standing bug.

See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431

Change-Id: I03518bcca43ea6c891a7f622972465c1ea87ce63
Reviewed-on: http://gerrit.cloudera.org:8080/6693
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <t...@apache.org>
---
M CMakeLists.txt
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Todd Lipcon: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/6693
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I03518bcca43ea6c891a7f622972465c1ea87ce63
Gerrit-PatchSet: 6
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <davidral...@gmail.com>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <davidral...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to