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 MyRocks compile warnings-treated-as-errors on Fedora 30, gcc 9.1.1 #5553

Closed
wants to merge 1 commit into from

Conversation

spetrunia
Copy link
Contributor

  • Provide assignment operator in CompactionStats
  • Provide a copy constructor for FileDescriptor
  • Remove std::move from "return std::move(t)" in BoundedQueue

- Provide assignment operator in CompactionStats
- Provide a copy constructor for FileDescriptor
- Remove std::move from "return std::move(t)" in BoundedQueue
@spetrunia
Copy link
Contributor Author

@spetrunia spetrunia changed the title Fix MyRocks compile warnings-treated-as-errors on Fedora 30, 9.1.1 Fix MyRocks compile warnings-treated-as-errors on Fedora 30, gcc 9.1.1 Jul 9, 2019
@spetrunia
Copy link
Contributor Author

re return std::move(t), my colleagues also point me to: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-return-move-local

Copy link
Contributor

@miasantreble miasantreble left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@siying has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 6187661.

rli9 pushed a commit to intel/lkp-tests that referenced this pull request Jul 16, 2019
fix the following issue:
```
./db/version_edit.h:76:8: error: implicitly-declared ‘constexpr rocksdb::FileDescriptor::FileDescriptor(const rocksdb::FileDescriptor&)’ is deprecated [-Werror=deprecated-copy]
   76 | struct FileMetaData {
      |        ^~~~~~~~~~~~
./db/version_edit.h:47:19: note: because ‘rocksdb::FileDescriptor’ has user-provided ‘rocksdb::FileDescriptor& rocksdb::FileDescriptor::operator=(const rocksdb::FileDescriptor&)’
   47 |   FileDescriptor& operator=(const FileDescriptor& fd) {
      |                   ^~~~~~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:64,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/string:40,
                 from ./db/builder.h:9,
                 from db/builder.cc:10:
/usr/include/c++/9/bits/stl_pair.h:312:51: note: synthesized method ‘rocksdb::FileMetaData::FileMetaData(const rocksdb::FileMetaData&)’ first required here
  312 |        : first(std::forward<_U1>(__x)), second(__y) { }
      |                                                   ^
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:1892: db/builder.o] Error 1
make[1]: Leaving directory '/root/lkp-tests/tmp-pkg/rocksdb/src/rocksdb-5.15.10'
```
The community has sent a patch to fix this problem(facebook/rocksdb#5553), but there is no release corresponding version, so download the code of the main branch first.

Signed-off-by: Zhou Hao <haox.a.zhou@intel.com>
Signed-off-by: Philip Li <philip.li@intel.com>
zhijianli88 pushed a commit to zhijianli88/lkp-tests that referenced this pull request Jul 23, 2019
fix the following issue:
```
./db/version_edit.h:76:8: error: implicitly-declared ‘constexpr rocksdb::FileDescriptor::FileDescriptor(const rocksdb::FileDescriptor&)’ is deprecated [-Werror=deprecated-copy]
   76 | struct FileMetaData {
      |        ^~~~~~~~~~~~
./db/version_edit.h:47:19: note: because ‘rocksdb::FileDescriptor’ has user-provided ‘rocksdb::FileDescriptor& rocksdb::FileDescriptor::operator=(const rocksdb::FileDescriptor&)’
   47 |   FileDescriptor& operator=(const FileDescriptor& fd) {
      |                   ^~~~~~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:64,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/string:40,
                 from ./db/builder.h:9,
                 from db/builder.cc:10:
/usr/include/c++/9/bits/stl_pair.h:312:51: note: synthesized method ‘rocksdb::FileMetaData::FileMetaData(const rocksdb::FileMetaData&)’ first required here
  312 |        : first(std::forward<_U1>(__x)), second(__y) { }
      |                                                   ^
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:1892: db/builder.o] Error 1
make[1]: Leaving directory '/root/lkp-tests/tmp-pkg/rocksdb/src/rocksdb-5.15.10'
```
The community has sent a patch to fix this problem(facebook/rocksdb#5553), but there is no release corresponding version, so download the code of the main branch first.

Signed-off-by: Zhou Hao <haox.a.zhou@intel.com>
Signed-off-by: Philip Li <philip.li@intel.com>
yiwu-arbug pushed a commit to tikv/rocksdb that referenced this pull request Jul 23, 2019
facebook#5553)

Summary:
- Provide assignment operator in CompactionStats
- Provide a copy constructor for FileDescriptor
- Remove std::move from "return std::move(t)" in BoundedQueue
Pull Request resolved: facebook#5553

Differential Revision: D16230170

fbshipit-source-id: fd7c6e52390b2db1be24141e25649cf62424d078
Signed-off-by: Yi Wu <yiwu@pingcap.com>
andreimatei pushed a commit to cockroachdb/rocksdb that referenced this pull request Oct 27, 2019
facebook#5553)

Fixes #66

This is a cherry-pick from Facebook's master.

Summary:
- Provide assignment operator in CompactionStats
- Provide a copy constructor for FileDescriptor
- Remove std::move from "return std::move(t)" in BoundedQueue
Pull Request resolved: facebook#5553

Differential Revision: D16230170

fbshipit-source-id: fd7c6e52390b2db1be24141e25649cf62424d078
andreimatei added a commit to cockroachdb/rocksdb that referenced this pull request Oct 27, 2019
Fix MyRocks compile warnings-treated-as-errors on Fedora 30, gcc 9.1.1 (facebook#5553)
merryChris pushed a commit to merryChris/rocksdb that referenced this pull request Nov 18, 2019
facebook#5553)

Summary:
- Provide assignment operator in CompactionStats
- Provide a copy constructor for FileDescriptor
- Remove std::move from "return std::move(t)" in BoundedQueue
Pull Request resolved: facebook#5553

Differential Revision: D16230170

fbshipit-source-id: fd7c6e52390b2db1be24141e25649cf62424d078
NicoK pushed a commit to NicoK/frocksdb that referenced this pull request Nov 28, 2019
…1 (#5553)

Summary:
- Provide assignment operator in CompactionStats
- Provide a copy constructor for FileDescriptor
- Remove std::move from "return std::move(t)" in BoundedQueue
Pull Request resolved: facebook/rocksdb#5553

Differential Revision: D16230170

fbshipit-source-id: fd7c6e52390b2db1be24141e25649cf62424d078
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants