-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.6.7
-
Component/s: Build
-
None
-
ALL
-
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
mongoDB 2.6.7 fails to build with gcc 5.0 .
There is problem with this:
-------------------------------------------------------------------
src/mongo/base/global_initializer.cpp:32:18: error: 'mongo::
::_theGlobalInitializer' defined but not used [-Werror=unused-variable]
Initializer* _theGlobalInitializer = &getGlobalInitializer();
^
-------------------------------------------------------------------
and also
-------------------------------------------------------------------
src/mongo/db/commands/index_filter_commands.cpp: In member function 'virtual mongo::Status mongo::ClearFilters::runIndexFilterCommand(const string&, mongo::BSONObj&, mongo::BSONObjBuilder*)':
src/mongo/db/commands/index_filter_commands.cpp:236:58: error: 'querySettings' may be used uninitialized in this function [-Werror=maybe-uninitialized]
return clear(querySettings, planCache, ns, cmdObj);
^
src/mongo/db/commands/index_filter_commands.cpp:236:58: error: 'planCache' may be used uninitialized in this function [-Werror=maybe-uninitialized]
src/mongo/db/commands/index_filter_commands.cpp: In member function 'virtual mongo::Status mongo::SetFilter::runIndexFilterCommand(const string&, mongo::BSONObj&, mongo::BSONObjBuilder*)':
src/mongo/db/commands/index_filter_commands.cpp:320:56: error: 'querySettings' may be used uninitialized in this function [-Werror=maybe-uninitialized]
return set(querySettings, planCache, ns, cmdObj);
^
src/mongo/db/commands/index_filter_commands.cpp:320:56: error: 'planCache' may be used uninitialized in this function [-Werror=maybe-uninitialized]
src/mongo/db/commands/index_filter_commands.cpp: In member function 'virtual mongo::Status mongo::ListFilters::runIndexFilterCommand(const string&, mongo::BSONObj&, mongo::BSONObjBuilder*)':
src/mongo/db/commands/index_filter_commands.cpp:179:40: error: 'querySettings' may be used uninitialized in this function [-Werror=maybe-uninitialized]
return list(*querySettings, bob);
^
-------------------------------------------------------------------
also with --disable-warnings-as-errors :
-------------------------------------------------------------------
src/mongo/db/commands/plan_cache_commands.cpp: In member function 'virtual mongo::Status mongo::PlanCacheListQueryShapes::runPlanCacheCommand(const string&, mongo::BSONObj&, mongo::BSONObjBuilder*)':
src/mongo/db/commands/plan_cache_commands.cpp:223:36: warning: 'planCache' may be used uninitialized in this function [-Wmaybe-uninitialized]
return list(*planCache, bob);
^
src/mongo/db/commands/plan_cache_commands.cpp: In member function 'virtual mongo::Status mongo::PlanCacheClear::runPlanCacheCommand(const string&, mongo::BSONObj&, mongo::BSONObjBuilder*)':
src/mongo/db/commands/plan_cache_commands.cpp:267:43: warning: 'planCache' may be used uninitialized in this function [-Wmaybe-uninitialized]
return clear(planCache, ns, cmdObj);
^
src/mongo/db/commands/plan_cache_commands.cpp:338:48: warning: 'planCache' may be used uninitialized in this function [-Wmaybe-uninitialized]
return list(*planCache, ns, cmdObj, bob);
^
-------------------------------------------------------------------
I suggest this could be fixed by adding -Wno-unused-variable and -Wno-maybe-uninitialized into SConstruct.
(same as -Wno-unused-function,...)
I don't tried it, but guess this affects all mongoDB versions...