summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-12-22 11:28:02 -0500
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-12-22 11:28:02 -0500
commit32635c99eca93e74aa52ae49f004be12dda66a8a (patch)
tree31c0abacc9e177c9aec102341ce2d903da3e607d
parent46f05091c9a7d46b3233a12f28d04e29b6f1dfc9 (diff)
downloadmongo-32635c99eca93e74aa52ae49f004be12dda66a8a.tar.gz
SERVER-26699 Enable MSVC flags for C++ standards alignment
-rw-r--r--SConstruct15
-rw-r--r--src/mongo/client/sasl_sspi.cpp2
-rw-r--r--src/mongo/util/net/ssl_manager.cpp8
3 files changed, 20 insertions, 5 deletions
diff --git a/SConstruct b/SConstruct
index 659aa29b879..3f4bbd38db0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1518,7 +1518,20 @@ elif env.TargetOSIs('windows'):
# Support large object files since some unit-test sources contain a lot of code
env.Append( CCFLAGS=["/bigobj"] )
- # This gives 32-bit programs 4 GB of user address space in WOW64, ignored in 64-bit builds
+ # Set Source and Executable character sets to UTF-8, this will produce a warning C4828 if the
+ # file contains invalid UTF-8.
+ env.Append( CCFLAGS=["/utf-8" ])
+
+ # Enforce type conversion rules for rvalue reference types as a result of a cast operation.
+ env.Append( CCFLAGS=["/Zc:rvalueCast"] )
+
+ # Disable string literal type conversion, instead const_cast must be explicitly specified.
+ env.Append( CCFLAGS=["/Zc:strictStrings"] )
+
+ # Treat volatile according to the ISO standard and do not guarantee acquire/release semantics.
+ env.Append( CCFLAGS=["/volatile:iso"] )
+
+ # This gives 32-bit programs 4 GB of user address space in WOW64, ignored in 64-bit builds.
env.Append( LINKFLAGS=["/LARGEADDRESSAWARE"] )
env.Append(
diff --git a/src/mongo/client/sasl_sspi.cpp b/src/mongo/client/sasl_sspi.cpp
index 67852c5098d..954746c211e 100644
--- a/src/mongo/client/sasl_sspi.cpp
+++ b/src/mongo/client/sasl_sspi.cpp
@@ -179,7 +179,7 @@ int sspiClientMechNew(void* glob_context,
pcctx->userPlusRealm = userPlusRealm;
TimeStamp ignored;
SECURITY_STATUS status = AcquireCredentialsHandleW(NULL, // principal
- L"kerberos",
+ const_cast<LPWSTR>(L"kerberos"),
SECPKG_CRED_OUTBOUND,
NULL, // LOGON id
&authIdentity, // auth data
diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp
index 6c31c58ce34..ed70d6b96a4 100644
--- a/src/mongo/util/net/ssl_manager.cpp
+++ b/src/mongo/util/net/ssl_manager.cpp
@@ -896,9 +896,11 @@ inline Status checkX509_STORE_error() {
#if defined(_WIN32)
// This imports the certificates in a given Windows certificate store into an X509_STORE for
// openssl to use during certificate validation.
-Status importCertStoreToX509_STORE(LPWSTR storeName, DWORD storeLocation, X509_STORE* verifyStore) {
- HCERTSTORE systemStore =
- CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, NULL, storeLocation, storeName);
+Status importCertStoreToX509_STORE(const wchar_t* storeName,
+ DWORD storeLocation,
+ X509_STORE* verifyStore) {
+ HCERTSTORE systemStore = CertOpenStore(
+ CERT_STORE_PROV_SYSTEM_W, 0, NULL, storeLocation, const_cast<LPWSTR>(storeName));
if (systemStore == NULL) {
return {ErrorCodes::InvalidSSLConfiguration,
str::stream() << "error opening system CA store: " << errnoWithDescription()};