diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 4f25f3969440c..359dc03e81323 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -20,7 +20,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/configureoptimization.cmake) #----------------------------------------------------- if(MSVC) - add_compile_options(/Zi /FC) + add_compile_options(/Zi /FC /Zc:strictStrings) elseif (CLR_CMAKE_HOST_UNIX) add_compile_options(-g) add_compile_options(-Wall) diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index 7da7ba35ae7cc..2febff3dd8869 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -14,7 +14,6 @@ endif (CLR_CMAKE_HOST_WIN32) if(MSVC) set(CMAKE_CXX_STANDARD_LIBRARIES "") # do not link against standard win32 libs i.e. kernel32, uuid, user32, etc. - add_compile_options(/Zc:strictStrings) if (CLR_CMAKE_HOST_ARCH_I386) add_compile_options(/Gz) endif (CLR_CMAKE_HOST_ARCH_I386) diff --git a/src/coreclr/tests/CMakeLists.txt b/src/coreclr/tests/CMakeLists.txt index c0d0759979a86..e98047c3a4452 100644 --- a/src/coreclr/tests/CMakeLists.txt +++ b/src/coreclr/tests/CMakeLists.txt @@ -8,7 +8,6 @@ include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) set(INC_PLATFORM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/Common/Platform) if (CLR_CMAKE_TARGET_WIN32) add_definitions(-DWINDOWS) - add_compile_options(/Zc:strictStrings) if (CLR_CMAKE_HOST_ARCH_I386) add_compile_options(/Gz) endif (CLR_CMAKE_HOST_ARCH_I386) diff --git a/src/installer/corehost/cli/hostmisc/pal.windows.cpp b/src/installer/corehost/cli/hostmisc/pal.windows.cpp index 63ffbc0b4fef2..0cb6d2f91d9e9 100644 --- a/src/installer/corehost/cli/hostmisc/pal.windows.cpp +++ b/src/installer/corehost/cli/hostmisc/pal.windows.cpp @@ -227,9 +227,9 @@ static bool get_wow_mode_program_files(pal::string_t* recv) { #if defined(TARGET_AMD64) - pal::char_t* env_key = _X("ProgramFiles(x86)"); + const pal::char_t* env_key = _X("ProgramFiles(x86)"); #else - pal::char_t* env_key = _X("ProgramFiles"); + const pal::char_t* env_key = _X("ProgramFiles"); #endif return get_file_path_from_env(env_key,recv); @@ -274,7 +274,7 @@ bool pal::get_default_installation_dir(pal::string_t* recv) } // *************************** - pal::char_t* program_files_dir; + const pal::char_t* program_files_dir; if (pal::is_running_in_wow64()) { program_files_dir = _X("ProgramFiles(x86)"); @@ -296,7 +296,7 @@ bool pal::get_default_installation_dir(pal::string_t* recv) namespace { - void get_dotnet_install_location_registry_path(HKEY * key_hive, pal::string_t * sub_key, pal::char_t ** value) + void get_dotnet_install_location_registry_path(HKEY * key_hive, pal::string_t * sub_key, const pal::char_t ** value) { *key_hive = HKEY_LOCAL_MACHINE; // The registry search occurs in the 32-bit registry in all cases. @@ -327,7 +327,7 @@ bool pal::get_dotnet_self_registered_config_location(pal::string_t* recv) #else HKEY key_hive; pal::string_t sub_key; - pal::char_t* value; + const pal::char_t* value; get_dotnet_install_location_registry_path(&key_hive, &sub_key, &value); *recv = (key_hive == HKEY_CURRENT_USER ? _X("HKCU\\") : _X("HKLM\\")) + sub_key + _X("\\") + value; @@ -354,7 +354,7 @@ bool pal::get_dotnet_self_registered_dir(pal::string_t* recv) HKEY hkeyHive; pal::string_t sub_key; - pal::char_t* value; + const pal::char_t* value; get_dotnet_install_location_registry_path(&hkeyHive, &sub_key, &value); // Must use RegOpenKeyEx to be able to specify KEY_WOW64_32KEY to access the 32-bit registry in all cases.