diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-01-14 17:20:36 -0500 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-01-14 17:21:07 -0500 |
commit | 1ca54ce0c33b691b1427e2b9f4a709835a02e25e (patch) | |
tree | d39806fdb5638e23a35401e62a970d0d27f4ff9a /src/mongo | |
parent | e5f17aafb8c2fbdcb9f7e6b478594a676fd2955b (diff) | |
download | mongo-1ca54ce0c33b691b1427e2b9f4a709835a02e25e.tar.gz |
SERVER-10142: Eliminate Compiler Warnings on Windows Builders
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/fts/fts_spec_test.cpp | 4 | ||||
-rw-r--r-- | src/mongo/s/version_manager.cpp | 2 | ||||
-rw-r--r-- | src/mongo/tools/restore.cpp | 2 | ||||
-rw-r--r-- | src/mongo/util/intrusive_counter.h | 8 | ||||
-rw-r--r-- | src/mongo/util/net/httpclient.cpp | 2 | ||||
-rw-r--r-- | src/mongo/util/net/miniwebserver.cpp | 2 | ||||
-rw-r--r-- | src/mongo/util/net/sock.cpp | 2 | ||||
-rw-r--r-- | src/mongo/util/options_parser/options_parser_test.cpp | 34 |
8 files changed, 32 insertions, 24 deletions
diff --git a/src/mongo/db/fts/fts_spec_test.cpp b/src/mongo/db/fts/fts_spec_test.cpp index 3df7ee1d301..e910ee1f0d8 100644 --- a/src/mongo/db/fts/fts_spec_test.cpp +++ b/src/mongo/db/fts/fts_spec_test.cpp @@ -51,7 +51,7 @@ namespace mongo { BSONObj fixed2 = FTSSpec::fixSpec( fixed ); ASSERT_EQUALS( fixed, fixed2 ); } - catch ( UserException& e ) { + catch ( UserException& ) { ASSERT( false ); } } @@ -66,7 +66,7 @@ namespace mongo { // fixSpec() on an invalid spec should uassert. BSONObj fixed = FTSSpec::fixSpec( user ); } - catch ( UserException& e ) { + catch ( UserException& ) { return; } ASSERT( false ); diff --git a/src/mongo/s/version_manager.cpp b/src/mongo/s/version_manager.cpp index 604fabb122e..02e9ff58b25 100644 --- a/src/mongo/s/version_manager.cpp +++ b/src/mongo/s/version_manager.cpp @@ -137,7 +137,7 @@ namespace mongo { ok = conn->runCommand("admin", cmd, result, 0); } - catch( const DBException& ex ) { + catch( const DBException& ) { if ( conn_in->type() != ConnectionString::SET ) { throw; diff --git a/src/mongo/tools/restore.cpp b/src/mongo/tools/restore.cpp index bc5d630730b..2673c1d031b 100644 --- a/src/mongo/tools/restore.cpp +++ b/src/mongo/tools/restore.cpp @@ -127,7 +127,7 @@ public: boost::lexical_cast<unsigned long>( mongoRestoreGlobalParams.oplogLimit.c_str()), boost::lexical_cast<unsigned long>(oplogInc.c_str()))); - } catch( const boost::bad_lexical_cast& error) { + } catch( const boost::bad_lexical_cast& ) { toolError() << "Could not parse oplogLimit into Timestamp from values ( " << mongoRestoreGlobalParams.oplogLimit << " , " << oplogInc << " )" << std::endl; diff --git a/src/mongo/util/intrusive_counter.h b/src/mongo/util/intrusive_counter.h index 51c92061bbb..911203085d1 100644 --- a/src/mongo/util/intrusive_counter.h +++ b/src/mongo/util/intrusive_counter.h @@ -115,7 +115,15 @@ namespace mongo { StringData stringData() const { return StringData(c_str(), _size); } static intrusive_ptr<const RCString> create(StringData s); + +// MSVC: C4291: 'declaration' : no matching operator delete found; memory will not be freed if +// initialization throws an exception +// We simply rely on the default global placement delete since a local placement delete would be +// ambiguous for some compilers +#pragma warning(push) +#pragma warning(disable : 4291) void operator delete (void* ptr) { free(ptr); } +#pragma warning(pop) private: // these can only be created by calling create() diff --git a/src/mongo/util/net/httpclient.cpp b/src/mongo/util/net/httpclient.cpp index 77b6ca09659..bb5d49e7892 100644 --- a/src/mongo/util/net/httpclient.cpp +++ b/src/mongo/util/net/httpclient.cpp @@ -140,7 +140,7 @@ namespace mongo { if ( result ) sb << buf; } - } catch (const SocketException& se) {} + } catch (const SocketException&) {} if ( result ) { diff --git a/src/mongo/util/net/miniwebserver.cpp b/src/mongo/util/net/miniwebserver.cpp index d7784e07a48..e9a6a24c094 100644 --- a/src/mongo/util/net/miniwebserver.cpp +++ b/src/mongo/util/net/miniwebserver.cpp @@ -125,7 +125,7 @@ namespace mongo { int x; try { x = psock->unsafe_recv( buf + len , left ); - } catch (const SocketException& se) { + } catch (const SocketException&) { psock->close(); return; } diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp index 1e8bd91ae41..edc7c54aa56 100644 --- a/src/mongo/util/net/sock.cpp +++ b/src/mongo/util/net/sock.cpp @@ -442,7 +442,7 @@ namespace mongo { try { _sslManager->SSL_shutdown( _sslConnection.get() ); } - catch (const SocketException& se) { // SSL_shutdown may throw if the connection fails + catch (const SocketException&) { // SSL_shutdown may throw if the connection fails } } #endif diff --git a/src/mongo/util/options_parser/options_parser_test.cpp b/src/mongo/util/options_parser/options_parser_test.cpp index 7ba815c4db4..aa73d36fb3c 100644 --- a/src/mongo/util/options_parser/options_parser_test.cpp +++ b/src/mongo/util/options_parser/options_parser_test.cpp @@ -99,7 +99,7 @@ namespace { testOpts.addOptionChaining("new", "dup", moe::Switch, "dup"); FAIL("Was able to register duplicate single name"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } @@ -110,7 +110,7 @@ namespace { testOpts.addOptionChaining("dup", "new", moe::Switch, "dup"); FAIL("Was able to register duplicate single name"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } @@ -123,7 +123,7 @@ namespace { .positional(1, 1); FAIL("Was able to register duplicate positional option"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } @@ -134,35 +134,35 @@ namespace { .positional(-1, 1); FAIL("Was able to register positional with negative start for range"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } try { testOpts.addOptionChaining("positional1", "positional1", moe::String, "Positional") .positional(2, 1); FAIL("Was able to register positional with start of range larger than end"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } try { testOpts.addOptionChaining("positional1", "positional1", moe::String, "Positional") .positional(1, -2); FAIL("Was able to register positional with bad end of range"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } try { testOpts.addOptionChaining("positional1", "positional1", moe::String, "Positional") .positional(0, 1); FAIL("Was able to register positional with bad start of range"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } try { testOpts.addOptionChaining("positional1", "positional1", moe::String, "Positional") .positional(1, 2); FAIL("Was able to register multi valued positional with non StringVector type"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } @@ -173,7 +173,7 @@ namespace { .setDefault(moe::Value("String")); FAIL("Was able to register default value with wrong type"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } @@ -184,7 +184,7 @@ namespace { .setImplicit(moe::Value("String")); FAIL("Was able to register implicit value with wrong type"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } @@ -195,7 +195,7 @@ namespace { "Multiple Values").composing(); FAIL("Was able to register composable option with wrong type"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } @@ -210,7 +210,7 @@ namespace { .composing(); FAIL("Was able to register composable option with implicit value"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } try { @@ -222,7 +222,7 @@ namespace { .setImplicit(moe::Value(implicitVal)); FAIL("Was able to set implicit value on composable option"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } @@ -237,7 +237,7 @@ namespace { .composing(); FAIL("Was able to register composable option with default value"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } try { @@ -249,7 +249,7 @@ namespace { .setDefault(moe::Value(defaultVal)); FAIL("Was able to set default value on composable option"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } @@ -262,7 +262,7 @@ namespace { .validRange(1000, 65535); FAIL("Was able to register non numeric option with constraint on range"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } @@ -273,7 +273,7 @@ namespace { .format("[0-9]*", "[0-9]*"); FAIL("Was able to register non string option with constraint on format"); } - catch (::mongo::DBException &e) { + catch (::mongo::DBException&) { } } |