Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clang13 build error (facebook#9374) #271

Merged
merged 1 commit into from
Mar 29, 2022
Merged

Conversation

tabokie
Copy link
Member

@tabokie tabokie commented Mar 28, 2022

Signed-off-by: tabokie xy.tao@outlook.com

Fix tikv/tikv#12204

@tabokie tabokie requested review from BusyJay and Connor1996 March 28, 2022 12:39
@BusyJay
Copy link
Member

BusyJay commented Mar 28, 2022

There is still one error:

/workspace/tirocks/tirocks-sys/rocksdb/db/db_impl/db_impl_write.cc:112:12: error: variable 'valid_batches' set but not used [-Werror,-Wunused-but-set-variable]
      size_t valid_batches = 0;
             ^
  1 error generated.

@@ -89,6 +89,7 @@ struct MutableDBOptions {
MutableDBOptions();
explicit MutableDBOptions(const MutableDBOptions& options) = default;
explicit MutableDBOptions(const DBOptions& options);
MutableDBOptions& operator=(const MutableDBOptions& options) = default;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why defining a default copy constructor in the first place?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, my fix here is not correct. I should've removed the uses of implicit assignment instead.

The explicit MutableDBOptions(const MutableDBOptions& options) is probably here to make creating copy of DB's mutable options less convenient, so we don't end up with lots of options with differing values.

Copy link
Member Author

@tabokie tabokie Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, the size_t valid_batches = 0; error is gone in the latest code.

@@ -89,6 +89,7 @@ struct MutableDBOptions {
MutableDBOptions();
explicit MutableDBOptions(const MutableDBOptions& options) = default;
explicit MutableDBOptions(const DBOptions& options);
MutableDBOptions& operator=(MutableDBOptions&& options) = default;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I download the latest rocksdb code and can build it without any errors. It seems they delete the explicit copy constructor instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit that introduces the change: facebook@9c6fb26

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll cherry-pick it instead.

Summary: Pull Request resolved: facebook#9374

Test Plan: Add CI for clang13 build

Reviewed By: riversand963

Differential Revision: D33522867

Pulled By: jay-zhuang

fbshipit-source-id: 642756825cf0b51e35861fb847ebaee4611b76ca
Signed-off-by: tabokie <xy.tao@outlook.com>
Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tabokie tabokie changed the title fix Mac build Fix clang13 build error (facebook#9374) Mar 29, 2022
@tabokie tabokie merged commit fb073b0 into tikv:6.4.tikv Mar 29, 2022
@tabokie tabokie deleted the fix-build branch March 29, 2022 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiKV fail to compile on MacOS
4 participants