You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "David Ribeiro Alves (Code Review)" <ge...@cloudera.org> on 2017/04/21 00:28:18 UTC

[kudu-CR] Silence clang -Waddress-of-packed-member warning in concurrent btree.h

Hello Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/6693

to look at the new patch set (#2).

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

Silence clang -Waddress-of-packed-member warning in concurrent_btree.h

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.

This patch silences this warning in concurrent_btree.h with a #pragma
statement.

Change-Id: I03518bcca43ea6c891a7f622972465c1ea87ce63
---
M src/kudu/tablet/concurrent_btree.h
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/93/6693/2
-- 
To view, visit http://gerrit.cloudera.org:8080/6693
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I03518bcca43ea6c891a7f622972465c1ea87ce63
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <da...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>