升级了MacOS 10.15 Beta版,结果编译 CockroachDB 遇到了问题。

[ %] Building CXX object CMakeFiles/rocksdb.dir/db/builder.cc.o
[ %] Building CXX object CMakeFiles/rocksdb.dir/db/column_family.cc.o
[ %] Building CXX object CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o
[ %] Building CXX object CMakeFiles/rocksdb.dir/db/compaction.cc.o
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_BYTES,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_BYTES, // Number of bytes written to WAL
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_SYNCED,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_SYNCED, // Number of times WAL sync is done
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
BYTES_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
BYTES_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
NUMBER_KEYS_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
NUMBER_KEYS_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_OTHER,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_OTHER, // Equivalent to writes done for others
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_SELF,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_SELF,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_WITH_WAL,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_WITH_WAL, // Number of Write calls that request WAL
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_BYTES,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_BYTES, // Number of bytes written to WAL
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_SYNCED,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_SYNCED, // Number of times WAL sync is done
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
BYTES_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
BYTES_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
NUMBER_KEYS_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
NUMBER_KEYS_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_OTHER,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_OTHER, // Equivalent to writes done for others
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_SELF,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_SELF,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_WITH_WAL,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_WITH_WAL, // Number of Write calls that request WAL
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_BYTES,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_BYTES, // Number of bytes written to WAL
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_SYNCED,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_SYNCED, // Number of times WAL sync is done
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
BYTES_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
BYTES_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
NUMBER_KEYS_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
NUMBER_KEYS_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_OTHER,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_OTHER, // Equivalent to writes done for others
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_SELF,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_SELF,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_WITH_WAL,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_WITH_WAL, // Number of Write calls that request WAL
^
errors generated.
gmake[]: *** [CMakeFiles/rocksdb.dir/build.make:: CMakeFiles/rocksdb.dir/db/builder.cc.o] Error
gmake[]: *** Waiting for unfinished jobs....
errors generated.
gmake[]: *** [CMakeFiles/rocksdb.dir/build.make:: CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o] Error
errors generated.
gmake[]: *** [CMakeFiles/rocksdb.dir/build.make:: CMakeFiles/rocksdb.dir/db/column_family.cc.o] Error
gmake[]: *** [CMakeFiles/Makefile2:: CMakeFiles/rocksdb.dir/all] Error
gmake[]: *** [CMakeFiles/Makefile2:: CMakeFiles/rocksdb.dir/rule] Error
gmake[]: *** [Makefile:: rocksdb] Error
gmake[]: *** [Makefile:: /usr/ports/databases/cockroach/work/cockroach-v19.1.1/native/x86_64-unknown-freebsd12./rocksdb/librocksdb.a] Error
gmake[]: Leaving directory '/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach'
gmake: *** [Makefile:: buildoss] Error
gmake: Leaving directory '/usr/ports/databases/cockroach/work/cockroach-v19.1.1'
*** Error code Stop.
make: stopped in /usr/ports/databases/cockroach

MacOS 使用的 C 语言编译器是 llvm 下的 clang,所有的 gcc 的使用都会被链接到 clang 的使用上。

比如检查 gcc 版本

$ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.
Apple clang version 11.0. (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

显示的就是 clang 的版本了。目前我的机器上的 clang 是 11.0.0

出现上面问题的原因是 clang 在8.0版本后对于代码的要求更为严格,有一种特殊的情况被判定为错误,无法正常编译。

报错信息中的 shadow 指的是函数内定义了和传入参数同名的变量,这就是 clang 拒绝的情况。

仔细看报错信息,可以看到这些错误都发生在 rocksdb 文件夹下。到目前为止,rocksdb 都没有要改一下代码的意思,因为又不是不能用。

编译的时候可以加上标签 -Wno-error= 让包含特定信息的错误强行不报错。

更改 /rocksdb/CMakeLists.txt 文件,diff 形式(如果是 CockroachDB 的工程,该文件在 /cockroach/c-deps/ 文件夹下):

option(FAIL_ON_WARNINGS "Treat compile warnings as errors" ON)
if(FAIL_ON_WARNINGS)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
else() # assume GCC
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")
endif()
endif()

修改 /rocksdb/Makefile 文件:

ifndef DISABLE_WARNING_AS_ERROR
- WARNING_FLAGS += -Werror
+ WARNING_FLAGS += # -Werror
endif

参考:

Problems building on FreeBSD (with clang 8)

gcc警告选项汇总

build: compile RocksDB with -Wno-error-shadow

 

clang8.0及以上编译rocks问题的更多相关文章

  1. hadoop-1.2.0源码编译

    以下为在CentOS-6.4下hadoop-1.2.0源码编译步骤. 1. 安装并且配置ant 下载ant,将ant目录下的bin文件夹加入到PATH变量中. 2. 安装git,安装autoconf, ...

  2. WebStorm 8.0安装LESS编译环境的教程

    WebStorm是一个非常棒的Web前端开发编辑器,被程序猿们成为“最智能的JavaScript IDE”.对HTML5.Bootstrap框架.Node.js等都有完美支持.目前最新版本为WebSt ...

  3. Hadoop系列(一)hadoop2.2.0源码编译

    操作系统:Centos 所需条件:能上网 编译所需工具: apache-ant-1.9.2-bin.tar.gz apache-maven-3.0.5-bin.tar.gz findbugs-2.0. ...

  4. Qt for Windows:Qt 5.4.0 MinGW 静态编译版本制作 (转)

    大致流程: 1.安装Qt(源码版)以及其他必要的环境 2.编译/安装 3.配置 4.使用 ----------正文分割线---------- 1.安装Qt(源码版) 1.1 下载Qt(两个地址二选一即 ...

  5. Android5.0 Gallery2上编译Gallery模块出错

    Android5.0 Gallery2上编译Gallery模块出错 时间:2015-05-05 19:32:57      阅读:105      评论:0      收藏:0      [点我收藏+ ...

  6. hadoop-2.6.0源码编译问题汇总

    在上一篇文章中,介绍了hadoop-2.6.0源码编译的一般流程,因个人计算机环境的不同, 编译过程中难免会出现一些错误,下面是我编译过程中遇到的错误. 列举出来并附上我解决此错误的方法,希望对大家有 ...

  7. Spark1.0.0 源码编译和部署包生成

    问题导读:1.如何对Spark1.0.0源码编译?2.如何生成Spark1.0的部署包?3.如何获取包资源? Spark1.0.0的源码编译和部署包生成,其本质只有两种:Maven和SBT,只不过针对 ...

  8. Thrift-0.10.0 CenOS 7 编译错误 error: expected ')' before 'PRIu32'

    Thrift-0.10.0 CenOS 7 编译错误 error: expected ')' before 'PRIu32' 在编译Thrift的时候,无论是Apache官网tar包,还是Github ...

  9. Spark2.0.0源码编译

    Hive默认使用MapReduce作为执行引擎,即Hive on mr,Hive还可以使用Tez和Spark作为其执行引擎,分别为Hive on Tez和Hive on Spark.由于MapRedu ...

随机推荐

  1. Supermarket POJ - 1456(贪心)

    题目大意:n个物品,每个物品有一定的保质期d和一定的利润p,一天只能出售一个物品,问最大利润是多少? 题解:这是一个贪心的题目,有两种做法. 1 首先排序,从大到小排,然后每个物品,按保质期从后往前找 ...

  2. tensorflow基础--LeNet-5测试模型遇到TypeError: Failed to convert object of type <class 'list'> to Tensor

    最近在看<TensorFlow 实战Google深度学习框架第二版>这本书,测试LeNet-5这个模型时遇到了TypeError: Failed to convert object of ...

  3. Volatile的应用DCL单例模式(四)

    Volatile的应用 单例模式DCL代码 首先回顾一下,单线程下的单例模式代码 /** * 单例模式 * * @author xiaocheng * @date 2020/4/22 9:19 */ ...

  4. vue2.x学习笔记(十六)

    接着前面的内容:https://www.cnblogs.com/yanggb/p/12616543.html. 组件中的插槽 在2.6.0的版本中,vue为具名插槽和作用域插槽引入了一个新的统一的语法 ...

  5. code-breaking picklecode中对signed_cookies引擎分析

    最近做了 ph 牛的 code-breaking,在做 picklecode 这一题时,没有搞懂那个 django 的 signed_cookies 引擎对 session 的操作,就 debug 了 ...

  6. python爬取优美图库海量图片,附加代码,一键爬取

    优美高清图片为大家提供高清美女套图赏析,非高清不录入,大家的网速要给力. 今天教大家爬取优美图库网站中高质量的图片!! 简单易上手哦~ 使用工具: Python 3.6 pycharm 相关环境: r ...

  7. python工业互联网监控项目实战5—Collector到opcua服务

    本小节演示项目是如何从连接器到获取Tank4C9服务上的设备对象的值,并通过Connector服务的url返回给UI端请求的.另外,实际项目中考虑websocket中间可能因为网络通信等原因出现中断情 ...

  8. thinkphp5 不使用form,用input+ajax异步上传图片

    不支持$this->request->file()获取图片 后台接收文件请使用$_FILE 正文开始: HTML <div class="upload"> ...

  9. tp5--相对路径和绝对路径

    首先,我们要先明白相对路径和绝对路径的理论: 绝对路径:是从盘符开始的路径,形如C:\windows\system32\cmd.exe相对路径:是从当前路径开始的路径,假如当前路径为C:\window ...

  10. 作业3-k均值算法

    4. 作业: 1). 扑克牌手动演练k均值聚类过程:>30张牌,3类 2). *自主编写K-means算法 ,以鸢尾花花瓣长度数据做聚类,并用散点图显示.(加分题) 3). 用sklearn.c ...