This warning prevents build without --disable-warning-as-errors.
Source code taken from master on Aug. 1 2016, with hash 2c1272d1e50b177fda189216fadabf1c6797890a
g++ -o build/opt/mongo/client/dbclient.o -c -Woverloaded-virtual -Wno-maybe-uninitialized -std=c++11 -fno-omit-frame-pointer -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-const-variable -Wno-unused-but-set-variable -Wno-missing-braces -fstack-protector-strong -fno-builtin-memcmp -fPIE -DPCRE_STATIC -DNDEBUG -D_FORTIFY_SOURCE=2 -DBOOST_THREAD_VERSION=4 -DBOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS -DBOOST_THREAD_HAS_NO_EINTR_BUG -Isrc/third_party/asio-asio-1-11-0/asio/include -Isrc/third_party/s2 -Isrc/third_party/pcre-8.39 -Isrc/third_party/boost-1.60.0 -Ibuild/opt -Isrc src/mongo/client/dbclient.cpp In file included from src/mongo/platform/compiler.h:151:0, from src/mongo/util/invariant.h:30, from src/mongo/base/string_data.h:41, from build/opt/mongo/base/error_codes.h:32, from src/mongo/base/status.h:34, from src/mongo/client/dbclient.cpp:37: src/mongo/client/dbclientcursor.h: In member function 'void mongo::DBClientCursor::_assertIfNull() const': src/mongo/util/assert_util.h:312:28: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare] if (MONGO_unlikely(!(expr))) { \ ^~~~~~~ src/mongo/platform/compiler_gcc.h:77:80: note: in definition of macro 'MONGO_unlikely' #define MONGO_unlikely(x) static_cast<bool>(__builtin_expect(static_cast<bool>(x), 0)) ^ src/mongo/util/assert_util.h:309:17: note: in expansion of macro 'MONGO_uassert' #define uassert MONGO_uassert ^~~~~~~~~~~~~ src/mongo/client/dbclientcursor.h:290:9: note: in expansion of macro 'uassert' uassert(13348, "connection died", this); ^~~~~~~ cc1plus: all warnings being treated as errors scons: *** [build/opt/mongo/client/dbclient.o] Error 1 scons: building terminated because of errors. build/opt/mongo/client/dbclient.o failed: Error 1
gcc version:
gcc (GCC) 6.1.1 20160707 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.