We should work to either suppress or fix all outstanding warnings from the Windows compiler and linker.
Afterwards, we should then promote all warnings to errors, to break the build if any new warnings appear.
Third-party code should be specially treated to suppress most warnings, via their SConscripts.
Original description:
Latest set of compiler warnings from MCI Windows 64-bit. Not shown here are warnings from src/third_party.
[2013/11/01 06:01:41.248] src\mongo\util\intrusive_counter.cpp(45) : warning C4291: 'void *mongo::RCString::operator new(size_t,size_t)' : no matching operator delete found; memory will not be freed if initialization throws an exception [2013/11/01 06:01:56.150] src\mongo\util\net\httpclient.cpp(143) : warning C4101: 'se' : unreferenced local variable [2013/11/01 06:06:12.609] src\mongo\util\net\miniwebserver.cpp(128) : warning C4101: 'se' : unreferenced local variable [2013/11/01 06:14:37.655] src\mongo\db\commands\storage_details.cpp(85) : warning C4351: new behavior: elements of array 'mongo::`anonymous-namespace'::DiskStorageData::freeRecords' will be default initialized [2013/11/01 06:16:20.871] D:\data\mci\git@github.commongodb\mongo.git\master\src\mongo/s/chunk_manager_targeter.h(122) : warning C4099: 'mongo::TargeterStats' : type name first seen using 'class' now seen using 'struct' [2013/11/01 06:17:01.347] D:\data\mci\git@github.commongodb\mongo.git\master\src\mongo/s/chunk_manager_targeter.h(122) : warning C4099: 'mongo::TargeterStats' : type name first seen using 'class' now seen using 'struct' [2013/11/01 06:17:27.038] src\mongo\tools\restore.cpp(118) : warning C4101: 'error' : unreferenced local variable [2013/11/01 06:20:58.223] src\mongo\client\examples\authTest.cpp(74) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:22:14.001] src\mongo\util\intrusive_counter.cpp(45) : warning C4291: 'void *mongo::RCString::operator new(size_t,size_t)' : no matching operator delete found; memory will not be freed if initialization throws an exception [2013/11/01 06:22:16.873] src\mongo\util\net\httpclient.cpp(143) : warning C4101: 'se' : unreferenced local variable [2013/11/01 06:23:12.028] D:\data\mci\git@github.commongodb\mongo.git\master\src\mongo/s/chunk_manager_targeter.h(122) : warning C4099: 'mongo::TargeterStats' : type name first seen using 'class' now seen using 'struct' [2013/11/01 06:25:43.328] src\mongo\dbtests\updatetests.cpp(1058) : warning C4065: switch statement contains 'default' but no 'case' labels [2013/11/01 06:25:43.329] src\mongo\dbtests\updatetests.cpp(1090) : warning C4065: switch statement contains 'default' but no 'case' labels [2013/11/01 06:30:01.197] src\mongo\util\options_parser\options_parser_test.cpp(63) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.198] src\mongo\util\options_parser\options_parser_test.cpp(74) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.199] src\mongo\util\options_parser\options_parser_test.cpp(87) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.201] src\mongo\util\options_parser\options_parser_test.cpp(98) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.201] src\mongo\util\options_parser\options_parser_test.cpp(105) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.210] src\mongo\util\options_parser\options_parser_test.cpp(112) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.210] src\mongo\util\options_parser\options_parser_test.cpp(119) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.210] src\mongo\util\options_parser\options_parser_test.cpp(126) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.210] src\mongo\util\options_parser\options_parser_test.cpp(137) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.210] src\mongo\util\options_parser\options_parser_test.cpp(148) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.210] src\mongo\util\options_parser\options_parser_test.cpp(159) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.210] src\mongo\util\options_parser\options_parser_test.cpp(174) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.210] src\mongo\util\options_parser\options_parser_test.cpp(186) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.210] src\mongo\util\options_parser\options_parser_test.cpp(201) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.214] src\mongo\util\options_parser\options_parser_test.cpp(213) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:01.310] src\mongo\util\options_parser\options_parser_test.cpp(1470) : warning C4101: 'e' : unreferenced local variable [2013/11/01 06:30:12.720] src\mongo\util\time_support_test.cpp(41) : warning C4996: 'putenv': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _putenv. See online help for details. [2013/11/01 06:30:12.720] src\mongo\util\time_support_test.cpp(44) : warning C4996: 'tzset': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _tzset. See online help for details. [2013/11/01 06:30:34.361] src\mongo\bson\bson_validate_test.cpp(101) : warning C4309: '=' : truncation of constant value
================
Here are the warnings, from mutable, updatetests, and working_set.
src\mongo\bson\mutable\document.cpp(2570) : warning C4390: ';' : empty controlled statement found; is this the intent? namespace.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library pch.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library D:\slave\Windows_64bit\mongo\src\mongo/db/exec/working_set_common.h(21) : warning C4099: 'mongo::WorkingSetMember' : type name first seen using 'struct' now seen using 'class' D:\slave\Windows_64bit\mongo\src\mongo/db/exec/working_set_common.h(21) : warning C4099: 'mongo::WorkingSetMember' : type name first seen using 'struct' now seen using 'class' src\mongo\db\commands\storage_details.cpp(85) : warning C4351: new behavior: elements of array 'mongo::`anonymous-namespace'::DiskStorageData::freeRecords' will be default initialized src\mongo\tools\restore.cpp(152) : warning C4101: 'error' : unreferenced local variable mutexdebugger.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library pch.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library namespace.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library D:\slave\Windows_64bit\mongo\src\mongo/db/exec/working_set_common.h(21) : warning C4099: 'mongo::WorkingSetMember' : type name first seen using 'struct' now seen using 'class' src\mongo\dbtests\updatetests.cpp(1053) : warning C4065: switch statement contains 'default' but no 'case' labels src\mongo\dbtests\updatetests.cpp(1085) : warning C4065: switch statement contains 'default' but no 'case' labels