The immediate problem is -Werror=nonnull-compare:
g++ -o build/opt/mongo/db/fts/fts_spec.o -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wnon-virtual-dtor -Woverloaded-virtual -Wno-maybe-uninitialized -std=c++11 -fno-omit-frame-pointer -fPIC -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-unused-variable -Wno-maybe-uninitialized -Wno-missing-braces -fno-builtin-memcmp -DNDEBUG -DBOOST_THREAD_VERSION=4 -DBOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD -DBOOST_SYSTEM_NO_DEPRECATED -Isrc/third_party/libstemmer_c/include -Isrc/third_party/s2 -Ibuild/opt -Isrc src/mongo/db/fts/fts_spec.cpp
In file included from src/mongo/platform/compiler.h:132:0,
from src/mongo/util/invariant.h:30,
from src/mongo/base/string_data.h:39,
from build/opt/mongo/base/error_codes.h:31,
from src/mongo/base/status.h:34,
from src/mongo/client/dbclient.cpp:36:
src/mongo/client/dbclientcursor.h: In member function 'void mongo::DBClientCursor::_assertIfNull() const':
src/mongo/util/assert_util.h:233:28: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
if (MONGO_unlikely(!(expr))) { \
^~~~~~~
src/mongo/platform/compiler_gcc.h:66: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:319:17: note: in expansion of macro 'MONGO_uassert'
#define uassert MONGO_uassert
^~~~~~~~~~~~~
src/mongo/client/dbclientcursor.h:295:9: note: in expansion of macro 'uassert'
uassert(13348, "connection died", this);
^~~~~~~
That appears to be the only new warning, so I guess we should add -Wno-error= nonnull- compare to disable- warnings. patch (this is https:/ /jira.mongodb. org/browse/ SERVER- 25385).
The next failure is this:
In file included from src/mongo/ base/parse_ number_ test.cpp: 38:0: base/parse_ number_ test.cpp: 297:49: error: exponent has no digits PARSES( double, "0xabcab. defdefP- 10", 0xabcab. defdefP- 10);
^ unittest/ unittest. h:105:93: note: in definition of macro '_ASSERT_ COMPARISON'
: :mongo: :unittest: :ComparisonAsse rtion_# #COMPARISON( __FILE_ _, __LINE__, #a, #b, a, b)) \
^ unittest/ unittest. h:84:29: note: in expansion of macro 'ASSERT_EQ'
^~~~~~ ~~~ base/parse_ number_ test.cpp: 44:9: note: in expansion of macro 'ASSERT_EQUALS'
ASSERT_ EQUALS( static_ cast<TYPE> (EXPECTED_ VALUE), v); \
^~~~~ ~~~~~~~ ~ base/parse_ number_ test.cpp: 297:5: note: in expansion of macro 'ASSERT_PARSES' PARSES( double, "0xabcab. defdefP- 10", 0xabcab. defdefP- 10);
src/mongo/
ASSERT_
src/mongo/
src/mongo/
#define ASSERT_EQUALS(a, b) ASSERT_EQ(a, b)
src/mongo/
src/mongo/
ASSERT_
^~~~~~~~~~~~~
which I think could be fixed by backporting the SConstruct part of
https:/ /github. com/mongodb/ mongo/commit/ a0c60da29313848 e6b4207a8d301d2 facdf3fd7c
and adding --cxx-std=14 to COMMON_OPTIONS.