facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
28.09k stars 6.25k forks source link

C++ compilation errors on Linux using g++ #12686

Open mmucklo opened 2 months ago

mmucklo commented 2 months ago

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

Expected behavior

rocksdb compiles fine using Linux (Ubuntu 22.04.4 LTS) with cmake 3.29 and g++ 11.4.0

Actual behavior

A number of compilation errors mostly related to casts are reported and prevent compilation.

Steps to reproduce the behavior

clone on Ubuntu and try building with g++

A sampling of the errors and their types:

rocksdb/table/block_based/block.cc:1330:31: error: cast from type ‘const rocksdb::Block*’ to type ‘void*’ casts away qualifiers [-Werror=cast-qual]
rocksdb/test_util/testutil.h:272:14: error: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Werror=cast-qual]
rocksdb/util/stderr_logger.cc:36:53: error: format not a string literal, argument types not checked [-Werror=format-nonlteral]
rocksdb/util/string_util.cc:165:29: error: ‘%c’ yields only last 2 digits of year in some locales [-Werror=format-y2k]

I'm attempting to use your repo in a school project, but because I'm also working full time and due to corporate hoops, I can't officially have a PR open for this, even though I tried, I ran into red tape once I verified I could sign the CLA.