diff --git a/eng/Build-Native.cmd b/eng/Build-Native.cmd index d9d5b46f79..d72b33f390 100644 --- a/eng/Build-Native.cmd +++ b/eng/Build-Native.cmd @@ -12,6 +12,11 @@ set __ThisScriptDir="%~dp0" call "%__ThisScriptDir%"\native\init-vs-env.cmd if NOT '%ERRORLEVEL%' == '0' goto ExitWithError +if defined VS170COMNTOOLS ( + set "__VSToolsRoot=%VS170COMNTOOLS%" + set "__VCToolsRoot=%VS170COMNTOOLS%\..\..\VC\Auxiliary\Build" + set __VSVersion=vs2022 +) if defined VS160COMNTOOLS ( set "__VSToolsRoot=%VS160COMNTOOLS%" set "__VCToolsRoot=%VS160COMNTOOLS%\..\..\VC\Auxiliary\Build" @@ -137,7 +142,7 @@ echo %__MsgPrefix%Commencing diagnostics repo build echo %__MsgPrefix%Checking prerequisites :: Eval the output from probe-win1.ps1 -for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__ProjectDir%\eng\set-cmake-path.ps1"""') do %%a +for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__ProjectDir%\eng\native\set-cmake-path.ps1"""') do %%a REM ========================================================================================= REM === @@ -148,11 +153,7 @@ REM ============================================================================ @if defined _echo @echo on :: Parse the optdata package versions out of msbuild so that we can pass them on to CMake -set __DotNetCli=%__ProjectDir%\.dotnet\dotnet.exe -if not exist "%__DotNetCli%" ( - echo %__MsgPrefix%Assertion failed: dotnet cli not found at path "%__DotNetCli%" - goto ExitWithError -) +set __DotNetCli=%__ProjectDir%\dotnet.cmd REM ========================================================================================= REM === @@ -198,7 +199,7 @@ if /i %__BuildCrossArch% EQU 1 ( popd :SkipConfigureCrossBuild - if not exist "%__CrossCompIntermediatesDir%\install.vcxproj" ( + if not exist "%__CrossCompIntermediatesDir%\CMakeCache.txt" ( echo %__MsgPrefix%Error: failed to generate cross-arch components build project! goto ExitWithError ) @@ -206,8 +207,8 @@ if /i %__BuildCrossArch% EQU 1 ( set __BuildLog="%__LogDir%\Cross.Build.binlog" - :: MSBuild.exe is the only one that has the C++ targets. "%__DotNetCli% msbuild" fails because VCTargetsPath isn't defined. - msbuild.exe %__CrossCompIntermediatesDir%\install.vcxproj /bl:!__BuildLog! %__CommonBuildArgs% + echo running "%CMakePath%" --build %__CrossCompIntermediatesDir% --target install --config %__BuildType% -- /bl:!__BuildLog! !__CommonBuildArgs! + "%CMakePath%" --build %__CrossCompIntermediatesDir% --target install --config %__BuildType% -- /bl:!__BuildLog! !__CommonBuildArgs! if not !ERRORLEVEL! == 0 ( echo %__MsgPrefix%Error: cross-arch components build failed. Refer to the build log files for details: @@ -273,14 +274,14 @@ if %__Build% EQU 1 ( :SkipConfigure if defined __ConfigureOnly goto SkipNativeBuild - if not exist "%__IntermediatesDir%\install.vcxproj" ( + if not exist "%__IntermediatesDir%\CMakeCache.txt" ( echo %__MsgPrefix%Error: failed to generate native component build project! goto ExitWithError ) set __BuildLog="%__LogDir%\Native.Build.binlog" - :: MSBuild.exe is the only one that has the C++ targets. "%__DotNetCli% msbuild" fails because VCTargetsPath isn't defined. - msbuild.exe %__IntermediatesDir%\install.vcxproj /bl:!__BuildLog! %__CommonBuildArgs% + echo running "%CMakePath%" --build %__IntermediatesDir% --target install --config %__BuildType% -- /bl:!__BuildLog! !__CommonBuildArgs! + "%CMakePath%" --build %__IntermediatesDir% --target install --config %__BuildType% -- /bl:!__BuildLog! !__CommonBuildArgs! if not !ERRORLEVEL! == 0 ( echo %__MsgPrefix%Error: native component build failed. Refer to the build log files for details: diff --git a/eng/build.sh b/eng/build.sh index 61824484c1..654ab0c0f5 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -218,6 +218,11 @@ if [[ "$__NativeBuild" == 1 ]]; then fi build_native "$__TargetOS" "$__BuildArch" "$__RepoRootDir" "$__IntermediatesDir" "install" "$__ExtraCmakeArgs" "diagnostic component" | tee "$__LogsDir"/make.log + + if [ "$?" != 0 ]; then + echo "Native build FAILED" + exit 1 + fi fi # diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index b67594cb60..c3e757ccde 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -78,6 +78,11 @@ if (MSVC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /PDBCOMPRESS") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1572864") + if(EXISTS ${CLR_SOURCELINK_FILE_PATH}) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /sourcelink:${CLR_SOURCELINK_FILE_PATH}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /sourcelink:${CLR_SOURCELINK_FILE_PATH}") + endif(EXISTS ${CLR_SOURCELINK_FILE_PATH}) + # Checked build specific flags add_linker_flag(/INCREMENTAL:NO CHECKED) # prevent "warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification" add_linker_flag(/OPT:REF CHECKED) @@ -390,6 +395,10 @@ if (CLR_CMAKE_HOST_UNIX) add_compile_options(-Wno-unused-but-set-variable) + # Turn off floating point expression contraction because it is considered a value changing + # optimization in the IEEE 754 specification and is therefore considered unsafe. + add_compile_options(-ffp-contract=off) + if (CMAKE_C_COMPILER_ID MATCHES "Clang") add_compile_options(-Wno-unknown-warning-option) @@ -489,10 +498,16 @@ if(CLR_CMAKE_TARGET_UNIX) add_compile_definitions($<$>>:TARGET_ANDROID>) elseif(CLR_CMAKE_TARGET_LINUX) add_compile_definitions($<$>>:TARGET_LINUX>) + if(CLR_CMAKE_TARGET_LINUX_MUSL) + add_compile_definitions($<$>>:TARGET_LINUX_MUSL>) + endif() elseif(CLR_CMAKE_TARGET_NETBSD) add_compile_definitions($<$>>:TARGET_NETBSD>) elseif(CLR_CMAKE_TARGET_SUNOS) add_compile_definitions($<$>>:TARGET_SUNOS>) + if(CLR_CMAKE_TARGET_OS_ILLUMOS) + add_compile_definitions($<$>>:TARGET_ILLUMOS>) + endif() endif() else(CLR_CMAKE_TARGET_UNIX) add_compile_definitions($<$>>:TARGET_WINDOWS>) @@ -541,8 +556,10 @@ if (MSVC) # /W3 is added by default by CMake, so remove it string(REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE "/W3" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - # set default warning level to 3 but allow targets to override it. - add_compile_options($<$:/W$>,$,3>>>) + + # [[! Microsoft.Security.SystemsADM.10086 !]] - SDL required warnings + # set default warning level to 4 but allow targets to override it. + add_compile_options($<$:/W$>,$,4>>>) add_compile_options($<$:/WX>) # treat warnings as errors add_compile_options($<$:/Oi>) # enable intrinsics add_compile_options($<$:/Oy->) # disable suppressing of the creation of frame pointers on the call stack for quicker function calls @@ -577,6 +594,7 @@ if (MSVC) add_compile_options($<$:/wd4456>) # declaration of 'identifier' hides previous local declaration add_compile_options($<$:/wd4457>) # declaration of 'identifier' hides function parameter add_compile_options($<$:/wd4458>) # declaration of 'identifier' hides class member + add_compile_options($<$:/wd4702>) # unreachable code add_compile_options($<$:/wd4733>) # Inline asm assigning to 'FS:0' : handler not registered as safe handler add_compile_options($<$:/wd4838>) # conversion from 'type_1' to 'type_2' requires a narrowing conversion add_compile_options($<$:/wd4960>) # 'function' is too big to be profiled @@ -586,11 +604,30 @@ if (MSVC) # Treat Warnings as Errors: add_compile_options($<$:/we4007>) # 'main' : must be __cdecl. add_compile_options($<$:/we4013>) # 'function' undefined - assuming extern returning int. + add_compile_options($<$:/we4018>) # 'expression' : signed/unsigned mismatch + add_compile_options($<$:/we4055>) # 'conversion' : from data pointer 'type1' to function pointer 'type2' add_compile_options($<$:/we4102>) # "'%$S' : unreferenced label". + add_compile_options($<$:/we4146>) # unary minus operator applied to unsigned type, result still unsigned + add_compile_options($<$:/we4242>) # 'identifier' : conversion from 'type1' to 'type2', possible loss of data + add_compile_options($<$:/we4244>) # 'conversion' conversion from 'type1' to 'type2', possible loss of data + add_compile_options($<$:/we4267>) # 'var' : conversion from 'size_t' to 'type', possible loss of data + add_compile_options($<$:/we4302>) # 'conversion' : truncation from 'type 1' to 'type 2' + add_compile_options($<$:/we4308>) # negative integral constant converted to unsigned type + add_compile_options($<$:/we4509>) # nonstandard extension used: 'function' uses SEH and 'object' has destructor + add_compile_options($<$:/we4510>) # 'class' : default constructor could not be generated + add_compile_options($<$:/we4532>) # 'continue' : jump out of __finally/finally block has undefined behavior during termination handling + add_compile_options($<$:/we4533>) # initialization of 'variable' is skipped by 'instruction' add_compile_options($<$:/we4551>) # Function call missing argument list. - add_compile_options($<$:/we4700>) # Local used w/o being initialized. + add_compile_options($<$:/we4610>) # object 'class' can never be instantiated - user-defined constructor required + add_compile_options($<$:/we4611>) # interaction between 'function' and C++ object destruction is non-portable add_compile_options($<$:/we4640>) # 'instance' : construction of local static object is not thread-safe + add_compile_options($<$:/we4700>) # Local used w/o being initialized. + add_compile_options($<$:/we4701>) # Potentially uninitialized local variable 'name' used + add_compile_options($<$:/we4703>) # Potentially uninitialized local pointer variable 'name' used + add_compile_options($<$:/we4789>) # destination of memory copy is too small add_compile_options($<$:/we4806>) # Unsafe operation involving type 'bool'. + add_compile_options($<$:/we4995>) # 'function': name was marked as #pragma deprecated + add_compile_options($<$:/we4996>) # 'function': was declared deprecated also 'std::': Function call with parameters that are potentially unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' # Set Warning Level 3: add_compile_options($<$:/w34092>) # Sizeof returns 'unsigned long'. @@ -727,4 +764,4 @@ if (CLR_CMAKE_HOST_WIN32) elseif (NOT CLR_CMAKE_HOST_BROWSER) enable_language(ASM) -endif(CLR_CMAKE_HOST_WIN32) +endif(CLR_CMAKE_HOST_WIN32) \ No newline at end of file diff --git a/eng/set-cmake-path.ps1 b/eng/set-cmake-path.ps1 deleted file mode 100644 index 5fc499a8c6..0000000000 --- a/eng/set-cmake-path.ps1 +++ /dev/null @@ -1,70 +0,0 @@ -# This file probes for the prerequisites for the build system, and outputs commands for eval'ing -# from the cmd scripts to set variables (and exit on error) - -function GetCMakeVersions -{ - $items = @() - $items += @(Get-ChildItem hklm:\SOFTWARE\Wow6432Node\Kitware -ErrorAction SilentlyContinue) - $items += @(Get-ChildItem hklm:\SOFTWARE\Kitware -ErrorAction SilentlyContinue) - return $items | where { $_.PSChildName.StartsWith("CMake") } -} - -function GetCMakeInfo($regKey) -{ - try { - $version = [System.Version] $regKey.PSChildName.Split(' ')[1] - } - catch { - return $null - } - $itemProperty = Get-ItemProperty $regKey.PSPath; - if (Get-Member -inputobject $itemProperty -name "InstallDir" -Membertype Properties) { - $cmakeDir = $itemProperty.InstallDir - } - else { - $cmakeDir = $itemProperty.'(default)' - } - $cmakePath = [System.IO.Path]::Combine($cmakeDir, "bin\cmake.exe") - if (![System.IO.File]::Exists($cmakePath)) { - return $null - } - return @{'version' = $version; 'path' = $cmakePath} -} - -function LocateCMake -{ - $errorMsg = "CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from http://www.cmake.org/download/ and ensure it is on your path." - $inPathPath = (get-command cmake.exe -ErrorAction SilentlyContinue) - if ($inPathPath -ne $null) { - # Resolve the first version of CMake if multiple commands are found - if ($inPathPath.Length -gt 1) { - return $inPathPath[0].Path - } - return $inPathPath.Path - } - # Let us hope that CMake keep using their current version scheme - $validVersions = @() - foreach ($regKey in GetCMakeVersions) { - $info = GetCMakeInfo($regKey) - if ($info -ne $null) { - $validVersions += @($info) - } - } - $newestCMakePath = ($validVersions | - Sort-Object -property @{Expression={$_.version}; Ascending=$false} | - select -first 1).path - if ($newestCMakePath -eq $null) { - Throw $errorMsg - } - return $newestCMakePath -} - -try { - $cmakePath = LocateCMake - [System.Console]::WriteLine("set CMakePath=" + $cmakePath) - -} -catch { - [System.Console]::Error.WriteLine($_.Exception.Message) - [System.Console]::WriteLine("exit /b 1") -} diff --git a/src/SOS/Strike/ExpressionNode.cpp b/src/SOS/Strike/ExpressionNode.cpp index c0ab323ec8..bc260ae241 100644 --- a/src/SOS/Strike/ExpressionNode.cpp +++ b/src/SOS/Strike/ExpressionNode.cpp @@ -645,7 +645,7 @@ HRESULT ExpressionNode::ExpandFields(ICorDebugValue* pInnerValue, __in_z WCHAR* if(varToExpand[0] == L'(' && pEndCast != NULL) { - int cchCastTypeName = ((int)(pEndCast-1-varToExpand))/2; + size_t cchCastTypeName = ((size_t)(pEndCast-1-varToExpand))/2; PopulateType(); if(_wcslen(pTypeName) != (cchCastTypeName) || _wcsncmp(varToExpand+1, pTypeName, cchCastTypeName) != 0) @@ -922,7 +922,7 @@ HRESULT ExpressionNode::PopulateTextValueHelper() BOOL isNull = TRUE; ToRelease pInnerValue; - CorElementType corElemType; + CorElementType corElemType = ELEMENT_TYPE_MAX; ULONG32 cbSize = 0; if(pValue != NULL) { @@ -954,7 +954,7 @@ HRESULT ExpressionNode::PopulateTextValueHelper() // one piece of data ICorDebugType will tell us if needed. if(FAILED(GetCanonicalElementTypeForTypeName(GetTypeName(), &corElemType))) { - pTypeCast->GetType(&corElemType); + IfFailRet(pTypeCast->GetType(&corElemType)); } switch(corElemType) diff --git a/src/SOS/Strike/sos_md.h b/src/SOS/Strike/sos_md.h index 71a874376d..1ddb33059e 100644 --- a/src/SOS/Strike/sos_md.h +++ b/src/SOS/Strike/sos_md.h @@ -68,7 +68,7 @@ typedef enum } PPFormatFlags; -char* asString(CQuickBytes *out); +static char* asString(CQuickBytes *out); PCCOR_SIGNATURE PrettyPrintType( PCCOR_SIGNATURE typePtr, // type to convert, @@ -98,4 +98,3 @@ void PrettyPrintClassFromToken( DWORD formatFlags = FormatCSharp); // the format flags for the types #endif - diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp index 51684fbb97..0796420ceb 100644 --- a/src/SOS/Strike/strike.cpp +++ b/src/SOS/Strike/strike.cpp @@ -7874,7 +7874,7 @@ DECLARE_API(bpmd) TypeName.data = new NOTHROW char[buffSize]; if (TypeName.data != NULL) { - int bytesWritten = WideCharToMultiByte(CP_ACP, 0, FunctionName, -1, TypeName.data, buffSize, NULL, NULL); + INDEBUG(int bytesWritten =) WideCharToMultiByte(CP_ACP, 0, FunctionName, -1, TypeName.data, buffSize, NULL, NULL); _ASSERTE(bytesWritten == buffSize); } } @@ -8498,7 +8498,6 @@ DECLARE_API(ThreadPool) TO_CDADDR(vPortableTpHcLogArray.ArrayDataPtr + (index * sizeof(HillClimbingLogEntry))); INT32 i32Value = 0; float f32Value = 0; - int fieldOffset = 0; if (FAILED(Status = MOVE(i32Value, entryPtr + portableTpHcLogEntry_tickCountOffset))) { @@ -12945,7 +12944,6 @@ class ClrStackImplWithICorDebug ExtOut("\nLOCALS:\n"); for (ULONG i=0; i < cLocals; i++) { - ULONG paramNameLen = 0; WCHAR paramName[mdNameLen] = W("\0"); ToRelease pValue; @@ -14012,7 +14010,6 @@ WatchCmd g_watchCmd; DECLARE_API(Watch) { INIT_API_NOEE(); - BOOL bExpression = FALSE; StringHolder addExpression; StringHolder aExpression; StringHolder saveName; diff --git a/src/SOS/extensions/hostcoreclr.cpp b/src/SOS/extensions/hostcoreclr.cpp index dfe67404c0..bd42a0b492 100644 --- a/src/SOS/extensions/hostcoreclr.cpp +++ b/src/SOS/extensions/hostcoreclr.cpp @@ -345,14 +345,14 @@ static bool FindDotNetVersion(const RuntimeVersion& runtimeVersion, std::string& FileFind find; if (find.Open(hostRuntimeDirectory.c_str())) { - int highestRevision = 0; + uint32_t highestRevision = 0; do { if (find.IsDirectory()) { - int major = 0; - int minor = 0; - int revision = 0; + uint32_t major = 0; + uint32_t minor = 0; + uint32_t revision = 0; if (sscanf(find.FileName(), "%d.%d.%d", &major, &minor, &revision) == 3) { if (major == runtimeVersion.Major && minor == runtimeVersion.Minor) diff --git a/src/dbgshim/dbgshim.cpp b/src/dbgshim/dbgshim.cpp index 0c418aecb1..a6ed03479e 100644 --- a/src/dbgshim/dbgshim.cpp +++ b/src/dbgshim/dbgshim.cpp @@ -106,11 +106,13 @@ struct ClrRuntimeInfo } }; +static HRESULT GetRuntime( DWORD debuggeePID, ClrRuntimeInfo& clrRuntimeInfo); +static HRESULT GetTargetCLRMetrics( LPCWSTR wszModulePath, @@ -118,10 +120,12 @@ GetTargetCLRMetrics( ClrInfo* pClrInfoOut = NULL, DWORD *pdwRVAContinueStartupEvent = NULL); +static void AppendDbiDllName( SString & szFullDbiPath); +static bool CheckDbiAndRuntimeVersion( SString & szFullDbiPath, @@ -1868,7 +1872,6 @@ GetDbiFilenameNextToRuntime( // Return Value: // true if the versions match // -static bool CheckDbiAndRuntimeVersion( SString & szFullDbiPath, diff --git a/src/dbgshim/debugshim.cpp b/src/dbgshim/debugshim.cpp index 964c69ac3c..40fa07a856 100644 --- a/src/dbgshim/debugshim.cpp +++ b/src/dbgshim/debugshim.cpp @@ -105,7 +105,7 @@ STDMETHODIMP CLRDebuggingImpl::OpenVirtualProcess( HMODULE hDbi = NULL; HMODULE hDac = NULL; ICorDebugDataTarget * pDt = NULL; - CLR_DEBUGGING_VERSION version; + CLR_DEBUGGING_VERSION version = {}; // argument checking if ((ppProcess != NULL || pFlags != NULL) && pLibraryProvider == NULL) @@ -667,7 +667,7 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget * pDataTarget, } } - CLR_DEBUG_RESOURCE debugResource; + CLR_DEBUG_RESOURCE debugResource = {}; if (SUCCEEDED(hr) && debugResourceSize != sizeof(debugResource)) { hr = CORDBG_E_NOT_CLR; diff --git a/src/shared/dbgutil/dbgutil.cpp b/src/shared/dbgutil/dbgutil.cpp index 242bf65eb8..984834b46c 100644 --- a/src/shared/dbgutil/dbgutil.cpp +++ b/src/shared/dbgutil/dbgutil.cpp @@ -64,14 +64,12 @@ HRESULT GetMachineAndResourceSectionRVA(ICorDebugDataTarget* pDataTarget, // after the signature is a 20 byte image file header // we need to parse this to figure out the target architecture - IMAGE_FILE_HEADER imageFileHeader; + IMAGE_FILE_HEADER imageFileHeader = {}; if (SUCCEEDED(hr)) { hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + peSigFilePointer + 4, (BYTE*)&imageFileHeader, IMAGE_SIZEOF_FILE_HEADER); } - - WORD optHeaderMagic = 0; DWORD peOptImageHeaderFilePointer = 0; if (SUCCEEDED(hr)) @@ -426,4 +424,4 @@ HRESULT ReadFromDataTarget(ICorDebugDataTarget* pDataTarget, } return hr; -} +} \ No newline at end of file diff --git a/src/shared/utilcode/longfilepathwrappers.cpp b/src/shared/utilcode/longfilepathwrappers.cpp index d1372faf30..bf23f23ba4 100644 --- a/src/shared/utilcode/longfilepathwrappers.cpp +++ b/src/shared/utilcode/longfilepathwrappers.cpp @@ -50,7 +50,7 @@ LoadLibraryExWrapper( HRESULT hr = S_OK; HMODULE ret = NULL; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -102,7 +102,7 @@ CreateFileWrapper( CONTRACTL_END; HRESULT hr = S_OK; - DWORD lastError; + DWORD lastError = 0; HANDLE ret = INVALID_HANDLE_VALUE; EX_TRY @@ -150,7 +150,7 @@ GetFileAttributesWrapper( HRESULT hr = S_OK; DWORD ret = INVALID_FILE_ATTRIBUTES; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -194,7 +194,7 @@ GetFileAttributesExWrapper( HRESULT hr = S_OK; BOOL ret = FALSE; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -239,7 +239,7 @@ DeleteFileWrapper( HRESULT hr = S_OK; BOOL ret = FALSE; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -283,7 +283,7 @@ MoveFileExWrapper( HRESULT hr = S_OK; BOOL ret = FALSE; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -334,7 +334,7 @@ SearchPathWrapper( HRESULT hr = S_OK; DWORD ret = 0; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -424,7 +424,7 @@ GetModuleFileNameWrapper( HRESULT hr = S_OK; DWORD ret = 0; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -482,7 +482,7 @@ UINT WINAPI GetTempFileNameWrapper( HRESULT hr = S_OK; UINT ret = 0; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -526,7 +526,7 @@ DWORD WINAPI GetTempPathWrapper( HRESULT hr = S_OK; DWORD ret = 0; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -567,7 +567,7 @@ DWORD WINAPI GetCurrentDirectoryWrapper( HRESULT hr = S_OK; DWORD ret = 0; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -609,7 +609,7 @@ DWORD WINAPI GetEnvironmentVariableWrapper( HRESULT hr = S_OK; DWORD ret = 0; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -677,7 +677,7 @@ CopyFileExWrapper( HRESULT hr = S_OK; BOOL ret = FALSE; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -730,7 +730,7 @@ FindFirstFileExWrapper( HRESULT hr = S_OK; HANDLE ret = INVALID_HANDLE_VALUE; - DWORD lastError; + DWORD lastError = 0; EX_TRY { @@ -937,6 +937,3 @@ BOOL LongFile::IsDirectorySeparator(WCHAR c) { return c == DirectorySeparatorChar || c == AltDirectorySeparatorChar; } - - - diff --git a/src/shared/utilcode/sstring.cpp b/src/shared/utilcode/sstring.cpp index 9ab6790efb..1901d65315 100644 --- a/src/shared/utilcode/sstring.cpp +++ b/src/shared/utilcode/sstring.cpp @@ -83,7 +83,7 @@ static WCHAR MapChar(WCHAR wc, DWORD dwFlags) if (dwFlags == LCMAP_UPPERCASE) { - wTmp = + wTmp = (WCHAR) #ifdef SELF_NO_HOST toupper(wc); #else @@ -93,7 +93,7 @@ static WCHAR MapChar(WCHAR wc, DWORD dwFlags) else { _ASSERTE(dwFlags == LCMAP_LOWERCASE); - wTmp = + wTmp = (WCHAR) #ifdef SELF_NO_HOST tolower(wc); #else @@ -2779,4 +2779,4 @@ bool SString::DacGetUnicode(COUNT_T cBufChars, return false; } -#endif //DACCESS_COMPILE +#endif //DACCESS_COMPILE \ No newline at end of file