diff --git a/change/react-native-windows-0553c349-bdaf-4bcc-ad68-074f1f4f5d7a.json b/change/react-native-windows-0553c349-bdaf-4bcc-ad68-074f1f4f5d7a.json new file mode 100644 index 00000000000..3cfff297b9e --- /dev/null +++ b/change/react-native-windows-0553c349-bdaf-4bcc-ad68-074f1f4f5d7a.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Remove disabling 4018 4055 4146 4242", + "packageName": "react-native-windows", + "email": "asklar@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Folly/Folly.vcxproj b/vnext/Folly/Folly.vcxproj index dd6b8bccc8c..1da41e48b13 100644 --- a/vnext/Folly/Folly.vcxproj +++ b/vnext/Folly/Folly.vcxproj @@ -250,7 +250,7 @@ $(ReactNativeWindowsDir)stubs;$(FollyDir);%(AdditionalIncludeDirectories) FOLLY_NO_CONFIG;NOMINMAX;_CRT_SECURE_NO_WARNINGS;WINAPI_PARTITION_APP;%(PreprocessorDefinitions) - 4018;4146;4244;4251;4267;4293;4305;4800;4804;4310;%(DisableSpecificWarnings) + 4244;4251;4267;4293;4305;4800;4804;4310;%(DisableSpecificWarnings) /Zc:__cplusplus %(AdditionalOptions) diff --git a/vnext/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp b/vnext/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp index af868c06336..2956e811b1b 100644 --- a/vnext/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +++ b/vnext/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp @@ -8,11 +8,8 @@ #include "LinkingManagerModule.h" #include "Unicode.h" -#pragma warning(push) -#pragma warning(disable : 4146) #include #include -#pragma warning(pop) #if _MSC_VER <= 1913 // VC 19 (2015-2017.6) cannot optimize co_await/cppwinrt usage diff --git a/vnext/Microsoft.ReactNative/Modules/TimingModule.cpp b/vnext/Microsoft.ReactNative/Modules/TimingModule.cpp index f90baaf6dab..0bae572b9a1 100644 --- a/vnext/Microsoft.ReactNative/Modules/TimingModule.cpp +++ b/vnext/Microsoft.ReactNative/Modules/TimingModule.cpp @@ -13,10 +13,7 @@ #include #include -#pragma warning(push) -#pragma warning(disable : 4146) #include -#pragma warning(pop) #include diff --git a/vnext/Microsoft.ReactNative/Modules/WebSocketModuleUwp.cpp b/vnext/Microsoft.ReactNative/Modules/WebSocketModuleUwp.cpp index 2b7bd739e39..d5079d23676 100644 --- a/vnext/Microsoft.ReactNative/Modules/WebSocketModuleUwp.cpp +++ b/vnext/Microsoft.ReactNative/Modules/WebSocketModuleUwp.cpp @@ -14,11 +14,8 @@ #include "Unicode.h" #include "Utilities.h" -#pragma warning(push) -#pragma warning(disable : 4146) #include #include -#pragma warning(pop) #if _MSC_VER <= 1913 // VC 19 (2015-2017.6) cannot optimize co_await/cppwinrt usage diff --git a/vnext/Microsoft.ReactNative/ReactHost/ReactNativeHeaders.h b/vnext/Microsoft.ReactNative/ReactHost/ReactNativeHeaders.h index 497942509ef..85fa110760e 100644 --- a/vnext/Microsoft.ReactNative/ReactHost/ReactNativeHeaders.h +++ b/vnext/Microsoft.ReactNative/ReactHost/ReactNativeHeaders.h @@ -9,9 +9,7 @@ #pragma warning(push) -#pragma warning(disable : 4995) #pragma warning(disable : 4068) -#pragma warning(disable : 4146) #pragma warning(disable : 4100) #pragma warning(disable : 4324) // structure was padded due to alignment specifier diff --git a/vnext/Microsoft.ReactNative/Utils/ValueUtils.cpp b/vnext/Microsoft.ReactNative/Utils/ValueUtils.cpp index 69ef7354703..de067d1b5f4 100644 --- a/vnext/Microsoft.ReactNative/Utils/ValueUtils.cpp +++ b/vnext/Microsoft.ReactNative/Utils/ValueUtils.cpp @@ -11,10 +11,7 @@ #include #include -#pragma warning(push) -#pragma warning(disable : 4995) #include -#pragma warning(pop) namespace winrt { using namespace Windows::Foundation; diff --git a/vnext/Mso/comUtil/qiCastCore.h b/vnext/Mso/comUtil/qiCastCore.h index 067e28f720b..371322983f6 100644 --- a/vnext/Mso/comUtil/qiCastCore.h +++ b/vnext/Mso/comUtil/qiCastCore.h @@ -62,10 +62,6 @@ Mso::CntPtr qi_cast(const TSource *piSource, const IID &riid = __uuidof return qi_cast(piSourceNonConst, riid); } -#pragma warning(push) -#pragma warning(disable : 4995) // VerifyElseCrashSz gives "warning C4995: 'IsDebuggerPresent': name was marked as - // #pragma deprecated" - /** qi_cast_or_crash(source, optional riid) @@ -92,8 +88,6 @@ Mso::CntPtr qi_cast_or_crash(const TSource *piSource, const IID &riid = return target; } -#pragma warning(pop) - /** simpleqi_cast(source, optional riid) diff --git a/vnext/Mso/debugAssertApi/debugAssertApi.h b/vnext/Mso/debugAssertApi/debugAssertApi.h index 08eac5b29ef..4a478c988cc 100644 --- a/vnext/Mso/debugAssertApi/debugAssertApi.h +++ b/vnext/Mso/debugAssertApi/debugAssertApi.h @@ -61,7 +61,6 @@ if (FAssertDo(f)) { ... } // same as "if (f) { ... } else Assert(false);" /** Suppressed warnings in Assert macros: C4127 - if/while loop condition is a constant - C4018 - signed/unsigned compare was converted to unsigned/unsigned compare C4389 - operation involved signed/unsigned variables 6239 - OACR left expression is always false 25011 - OACR missing 'break' or '__fallthrough' statement @@ -73,8 +72,7 @@ Suppressed warnings in Assert macros: 25064 - OACR function called twice in macro */ #define AssertDetails_Statement_Begin \ - __pragma(warning(push)) \ - __pragma(warning(disable : 4127 4018 4389 6239 25037 25038 25039 25041 25042 25064 25306)) do { + __pragma(warning(push)) __pragma(warning(disable : 4127 4389 6239 25037 25038 25039 25041 25042 25064 25306)) do { #define AssertDetails_Statement_End \ } \ while (0) \ diff --git a/vnext/Mso/object/queryCast.h b/vnext/Mso/object/queryCast.h index 62d0271fc89..9d6aa265a43 100644 --- a/vnext/Mso/object/queryCast.h +++ b/vnext/Mso/object/queryCast.h @@ -41,8 +41,6 @@ Here we provide a number of helper templates to implement QueryCast for a type: // inaccessible or deleted #pragma warning(disable : 4626) // assignment operator could not be generated because a base class assignment operator // is inaccessible or deleted -#pragma warning(disable : 4995) // 'IsDebuggerPresent': name was marked as #pragma deprecated. It is part of - // VerifyElseCrash macro. namespace Mso { diff --git a/vnext/PropertySheets/Warnings.props b/vnext/PropertySheets/Warnings.props index 737d83b18ea..01643d0d0b8 100644 --- a/vnext/PropertySheets/Warnings.props +++ b/vnext/PropertySheets/Warnings.props @@ -4,14 +4,13 @@ - 4146;4201;4505;4456;4458;4702 + 4201;4505;4456;4458;4702