This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new b198692 [build] address compilation warnings from GCC 8.3.1
b198692 is described below
commit b198692abacd913db0ce64b5961fc05d0fb2951d
Author: Alexey Serbin <[email protected]>
AuthorDate: Sat Mar 14 13:30:06 2020 -0700
[build] address compilation warnings from GCC 8.3.1
While compiling on CentOS 8.1 with GCC 8.3.1, the following warnings
were observed:
src/kudu/util/env_posix.cc:1523:11: warning: unnecessary parentheses in
declaration of ‘paths’ [-Wparentheses]
char *(paths[]) = { name_dup.get(), nullptr };
src/kudu/tablet/concurrent_btree.h: In instantiation of ‘void
kudu::tablet::btree::CBTreeIterator<Traits>::SeekToLeaf(const kudu::Slice&)
[with Traits = kudu::tablet::btree::SmallFanoutTraits]’:
src/kudu/tablet/concurrent_btree.h:1624:5: required from ‘bool
kudu::tablet::btree::CBTreeIterator<Traits>::SeekAtOrAfter(const kudu::Slice&,
bool*) [with Traits = kudu::tablet::btree::SmallFanoutTraits]’
src/kudu/tablet/cbtree-test.cc:502:5: required from here
src/kudu/tablet/concurrent_btree.h:1792:15: warning: ‘void* memcpy(void*,
const void*, size_t)’ writing to an object of type ‘class
kudu::tablet::btree::LeafNode<kudu::tablet::btree::SmallFanoutTraits>’ with no
trivial copy-assignment [-Wclass-memaccess]
memcpy(&leaf_copy_, leaf, sizeof(leaf_copy_));
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/kudu/tablet/concurrent_btree.h:677:7: note: ‘class
kudu::tablet::btree::LeafNode<kudu::tablet::btree::SmallFanoutTraits>’ declared
here
class LeafNode : public NodeBase<Traits> {
This patch doesn't contain any functional modifications, it only fixes
the warnings above.
Change-Id: Ifc1ff1bbba48846d91c39c2a53ff0ead1bf3f513
Reviewed-on: http://gerrit.cloudera.org:8080/15437
Tested-by: Alexey Serbin <[email protected]>
Reviewed-by: Adar Dembo <[email protected]>
---
src/kudu/tablet/concurrent_btree.h | 4 ++--
src/kudu/util/env_posix.cc | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/kudu/tablet/concurrent_btree.h
b/src/kudu/tablet/concurrent_btree.h
index 57ea0bb..2084af4 100644
--- a/src/kudu/tablet/concurrent_btree.h
+++ b/src/kudu/tablet/concurrent_btree.h
@@ -1789,7 +1789,7 @@ class CBTreeIterator {
retry_in_leaf:
{
- memcpy(&leaf_copy_, leaf, sizeof(leaf_copy_));
+ memcpy(static_cast<void*>(&leaf_copy_), leaf, sizeof(leaf_copy_));
AtomicVersion new_version = leaf->StableVersion();
if (VersionField::HasSplit(version, new_version)) {
@@ -1831,7 +1831,7 @@ class CBTreeIterator {
while (true) {
AtomicVersion version = next->StableVersion();
- memcpy(&leaf_copy_, next, sizeof(leaf_copy_));
+ memcpy(static_cast<void*>(&leaf_copy_), next, sizeof(leaf_copy_));
AtomicVersion new_version = next->StableVersion();
if (VersionField::IsDifferent(new_version, version)) {
version = new_version;
diff --git a/src/kudu/util/env_posix.cc b/src/kudu/util/env_posix.cc
index 2dc608b..6545dfb 100644
--- a/src/kudu/util/env_posix.cc
+++ b/src/kudu/util/env_posix.cc
@@ -1520,7 +1520,7 @@ class PosixEnv : public Env {
// FTS requires a non-const copy of the name. strdup it and free() when
// we leave scope.
unique_ptr<char[], FreeDeleter> name_dup(strdup(root.c_str()));
- char *(paths[]) = { name_dup.get(), nullptr };
+ char* paths[] = { name_dup.get(), nullptr };
// FTS_NOCHDIR is important here to make this thread-safe.
FTS* ret;
@@ -1531,7 +1531,7 @@ class PosixEnv : public Env {
}
unique_ptr<FTS, FtsCloser> tree(ret);
- FTSENT *ent = nullptr;
+ FTSENT* ent = nullptr;
bool had_errors = false;
while ((ent = fts_read(tree.get())) != nullptr) {
bool doCb = false;