My Mac force-updated its XCode to 12.0 and with the Clang which comes with that version, MongoDB fails to compile with the following error:
[kaloianm@Kal-MacBook-Pro:~/workspace/mongo]$ python3 buildscripts/scons.py --ssl --variables-files=etc/scons/xcode_macosx.vars --libc++ --detect-odr-violations --dbg=on --opt=off VARIANT_DIR=ninja --ninja=next generate-ninja ... [kaloianm@Kal-MacBook-Pro:~/workspace/mongo]$ ninja build/ninja/mongo/client/authenticate.o [1/1] Compiling build/ninja/mongo/client/authenticate.o FAILED: build/ninja/mongo/client/authenticate.o PATH='/usr/local/bin:/opt/bin:/bin:/usr/bin' PATHOSX='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin' /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ @build/ninja/mongo/client/authenticate.o.rsp src/mongo/client/authenticate.cpp:215:29: error: loop variable 'elem' of type 'const mongo::BSONElement' creates a copy from type 'const mongo::BSONElement' [-Werror,-Wrange-loop-analysis] for (const auto elem : obj) { ^ src/mongo/client/authenticate.cpp:215:18: note: use reference type 'const mongo::BSONElement &' to prevent copying for (const auto elem : obj) { ^~~~~~~~~~~~~~~~~ & 1 error generated.
This is the clang versions that I have now:
[kaloianm@Kal-MacBook-Pro:~/workspace/mongo]$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --version Apple clang version 12.0.0 (clang-1200.0.32.2) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin [kaloianm@Kal-MacBook-Pro:~/workspace/mongo]$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ --version Apple clang version 12.0.0 (clang-1200.0.32.2) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
- related to
-
SERVER-51231 suspicious long long to double conversions in bounds checks
- Closed
- split to
-
SERVER-51178 Add ability to disable specific compiler warnings-as-errors from SCons
- Closed