-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Build fail with gcc 9 #5303
Comments
Introduced by gcc 9's new warning checker [-Werror=deprecated-copy] Here is a fix example: |
It doesn't compile with clang 8 either unfortunately.
|
I managed to build and install RocksDB on my Fedora 30 system with these commands: CXXFLAGS='-Wno-error=deprecated-copy -Wno-error=pessimizing-move' make shared_lib
sudo make install-shared I hope that information is useful for anyone else trying. |
The same problem using GCC 9.1 on Ubuntu 18.04 to build The Explicit copy constructor needs to be implemented, which is also a good practice alongside copy-assignment as follows:
The Using After fixing the above errors as described (and the fix works fine), getting the following:
So, now the |
Voila, a pull request here |
@miasantreble should we mark this as fixed by #5553 ? |
should be fixed in #6697 |
When compiling cubefs using a newer version gcc (version 10.2.1), it complains that: ./db/version_edit.h:156:33: error: implicitly-declared ‘constexpr rocksdb::FileDescriptor::FileDescriptor(const rocksdb::FileDescriptor&)’ is deprecated [-Werror=deprecated-copy] 76 | struct FileMetaData { | ^~~~~~~~~~~~ ./memtable/inlineskiplist.h:282:11: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::atomic<rocksdb::InlineSkipList<const rocksdb::MemTableRep::KeyComparator&>::Node*>’ with no trivial copy-assignment [-Werror=class-memaccess] 282 | memcpy(&next_[0], &height, sizeof(int)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./utilities/persistent_cache/persistent_cache_util.h:51:23: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move] 51 | return std::move(t); | ^ The best way to address that is to backport patches or upgrade rocksdb. However this is a big move for cubefs. So let's just switch these errors off temporarily to make gcc happy. Reference: facebook/rocksdb#5303 Signed-off-by: Sheng Yong <shengyong2021@gmail.com>
When compiling cubefs using a newer version gcc (version 10.2.1), it complains that: ./db/version_edit.h:156:33: error: implicitly-declared ‘constexpr rocksdb::FileDescriptor::FileDescriptor(const rocksdb::FileDescriptor&)’ is deprecated [-Werror=deprecated-copy] 76 | struct FileMetaData { | ^~~~~~~~~~~~ ./memtable/inlineskiplist.h:282:11: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::atomic<rocksdb::InlineSkipList<const rocksdb::MemTableRep::KeyComparator&>::Node*>’ with no trivial copy-assignment [-Werror=class-memaccess] 282 | memcpy(&next_[0], &height, sizeof(int)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./utilities/persistent_cache/persistent_cache_util.h:51:23: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move] 51 | return std::move(t); | ^ The best way to address that is to backport patches or upgrade rocksdb. However this is a big move for cubefs. So let's just switch these errors off temporarily to make gcc happy. Reference: facebook/rocksdb#5303 Signed-off-by: Sheng Yong <shengyong2021@gmail.com>
When compiling cubefs using a newer version gcc (version 10.2.1), it complains that: ./db/version_edit.h:156:33: error: implicitly-declared ‘constexpr rocksdb::FileDescriptor::FileDescriptor(const rocksdb::FileDescriptor&)’ is deprecated [-Werror=deprecated-copy] 76 | struct FileMetaData { | ^~~~~~~~~~~~ ./memtable/inlineskiplist.h:282:11: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::atomic<rocksdb::InlineSkipList<const rocksdb::MemTableRep::KeyComparator&>::Node*>’ with no trivial copy-assignment [-Werror=class-memaccess] 282 | memcpy(&next_[0], &height, sizeof(int)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./utilities/persistent_cache/persistent_cache_util.h:51:23: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move] 51 | return std::move(t); | ^ The best way to address that is to backport patches or upgrade rocksdb. However this is a big move for cubefs. So let's just switch these errors off temporarily to make gcc happy. Reference: facebook/rocksdb#5303 Signed-off-by: Sheng Yong <shengyong2021@gmail.com>
this seem fixed as of newer rocksdb versions |
Expected behavior
Compilation completes successfully.
Actual behavior
Compilation failure:
Steps to reproduce the behavior
Simple make command can reproduce the error.
The text was updated successfully, but these errors were encountered: