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

Make failed on Redhat 8 #474

Open
qin-nz opened this issue Dec 31, 2019 · 4 comments
Open

Make failed on Redhat 8 #474

qin-nz opened this issue Dec 31, 2019 · 4 comments

Comments

@qin-nz
Copy link

qin-nz commented Dec 31, 2019

Run make, then

util/status.cc: In static member function ‘static const char* rocksdb::Status::CopyState(const char*)’:
util/status.cc:28:15: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
   std::strncpy(result, state, cch - 1);
   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
util/status.cc:19:18: note: length computed here
       std::strlen(state) + 1; // +1 for the null terminator
       ~~~~~~~~~~~^~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [Makefile:1879: util/status.o] Error 1
make[2]: Leaving directory '/home/jc/ardb/deps/rocksdb-5.14.2'
make[1]: *** [Makefile:401: /home/jc/ardb/src/../deps/rocksdb-5.14.2/librocksdb.a] Error 2
make[1]: Leaving directory '/home/jc/ardb/src'
make: *** [Makefile:4: all] Error 2
gcc version 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC)
@chadlyon
Copy link

I created a PR for this: #479

@chadlyon
Copy link

chadlyon commented Feb 26, 2020

Closing PR #479 since you can actually get around this by doing

make CXX='g++ -Wno-error=stringop-truncation'

@chadlyon
Copy link

chadlyon commented Feb 26, 2020

In fact you will also need to add -Wno-error=format-truncation and -Wno-error=class-memaccess for ardb compile as well.

@stevedh
Copy link

stevedh commented Jun 14, 2021

This also occurs in Ubuntu 21 which has gcc 10.3.0. I agree it can be worked around with those error directives. I am not sure that is the right solution or if there is really an issue here that the compiler is detecting. However this should definitely remain open from what I can tell.

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

No branches or pull requests

3 participants