[CPP][Analyzers]Turn on warning 4127 (#21516)

Fix an occurrence on a if changing it to if constexpr
This commit is contained in:
sosssego 2022-11-11 11:01:12 +00:00 committed by GitHub
parent 02f9e3b22e
commit a8d2aeedf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@
<ClCompile>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>26800;28251;4127;4189;4239;4244;4245;4389;4456;4457;4701;6387;4458;4505;4515;4459;4702;6031;6248;26451;28182;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>26800;28251;4189;4239;4244;4245;4389;4456;4457;4701;6387;4458;4505;4515;4459;4702;6031;6248;26451;28182;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableAnalyzeExternal >true</DisableAnalyzeExternal>
<ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
<ConformanceMode>false</ConformanceMode>

View File

@ -13,7 +13,7 @@ namespace // Strings in this namespace should not be localized
{
const wchar_t LATEST_RELEASE_ENDPOINT[] = L"https://api.github.com/repos/microsoft/PowerToys/releases/latest";
const wchar_t ALL_RELEASES_ENDPOINT[] = L"https://api.github.com/repos/microsoft/PowerToys/releases";
const wchar_t LOCAL_BUILD_ERROR[] = L"Local build cannot be updated";
const wchar_t NETWORK_ERROR[] = L"Network error";
@ -70,7 +70,7 @@ namespace updating
std::future<nonstd::expected<github_version_info, std::wstring>> get_github_version_info_async(const bool prerelease)
{
// If the current version starts with 0.0.*, it means we're on a local build from a farm and shouldn't check for updates.
if (VERSION_MAJOR == 0 && VERSION_MINOR == 0)
if constexpr (VERSION_MAJOR == 0 && VERSION_MINOR == 0)
{
co_return nonstd::make_unexpected(LOCAL_BUILD_ERROR);
}

View File

@ -167,7 +167,7 @@ LONG WINAPI unhandled_exception_handler(PEXCEPTION_POINTERS info)
return EXCEPTION_CONTINUE_SEARCH;
}
extern "C" void AbortHandler(int signal_number)
extern "C" void AbortHandler(int /*signal_number*/)
{
init_symbols();
std::wstring ex_description = L"SIGABRT was raised.";