From 45dcbb96bacf219a16d91cf184d19be11bcdd429 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 20 Aug 2021 18:38:03 -0700 Subject: [PATCH 01/14] enable more warnings for MSVC Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- cmake/Platform/Common/MSVC/Configurations_msvc.cmake | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 9353e4eb1c..7b5646cb9e 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -40,12 +40,11 @@ ly_append_configurations_options( # Enabling warnings that are disabled by default from /W4 # https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019 /we4296 # 'operator': expression is always false - # /we4426 # optimization flags changed after including header, may be due to #pragma optimize() - # /we4464 # relative include path contains '..' - # /we4619 # #pragma warning: there is no warning number 'number' - # /we4777 # 'function' : format string 'string' requires an argument of type 'type1', but variadic argument number has type 'type2' - # /we5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file - # /WE5032 # detected #pragma warning(push) with no corresponding #pragma warning(pop) + /we4426 # optimization flags changed after including header, may be due to #pragma optimize() + /we4619 # #pragma warning: there is no warning number 'number' + /we4777 # 'function' : format string 'string' requires an argument of type 'type1', but variadic argument number has type 'type2' looks useful + /we5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file + /we5032 # detected #pragma warning(push) with no corresponding #pragma warning(pop) /Zc:forScope # Force Conformance in for Loop Scope /diagnostics:caret # Compiler diagnostic options: includes the column where the issue was found and places a caret (^) under the location in the line of code where the issue was detected. From e98bab8a75c563b2e4790c1e8f37a4bd2d4c9b42 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 20 Aug 2021 18:39:00 -0700 Subject: [PATCH 02/14] fixing format strings Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/LogFile.cpp | 4 ++-- Code/Editor/Util/GuidUtil.h | 4 ++-- .../Platform/Common/WinAPI/AzCore/Debug/Trace_WinAPI.cpp | 2 +- .../Platform/Windows/AzCore/Debug/StackTracer_Windows.cpp | 2 +- Code/Framework/GridMate/Tests/Carrier.cpp | 2 +- Code/Legacy/CrySystem/DebugCallStack.cpp | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Code/Editor/LogFile.cpp b/Code/Editor/LogFile.cpp index 5978356781..0a375882f6 100644 --- a/Code/Editor/LogFile.cpp +++ b/Code/Editor/LogFile.cpp @@ -288,7 +288,7 @@ AZ_POP_DISABLE_WARNING str += "Version Unknown"; } } - azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, " %d.%d", OSVerInfo.dwMajorVersion, OSVerInfo.dwMinorVersion); + azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, " %ld.%ld", OSVerInfo.dwMajorVersion, OSVerInfo.dwMinorVersion); str += szBuffer; ////////////////////////////////////////////////////////////////////// @@ -338,7 +338,7 @@ AZ_POP_DISABLE_WARNING str += " "; azstrdate(szBuffer); str += szBuffer; - azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, ", system running for %d minutes", GetTickCount() / 60000); + azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, ", system running for %ld minutes", GetTickCount() / 60000); str += szBuffer; CryLog("%s", str.toUtf8().data()); #else diff --git a/Code/Editor/Util/GuidUtil.h b/Code/Editor/Util/GuidUtil.h index 9952d6b4ed..c53589b6ca 100644 --- a/Code/Editor/Util/GuidUtil.h +++ b/Code/Editor/Util/GuidUtil.h @@ -48,7 +48,7 @@ inline bool GuidUtil::IsEmpty(REFGUID guid) inline const char* GuidUtil::ToString(REFGUID guid) { static char guidString[64]; - sprintf_s(guidString, "{%.8X-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], + sprintf_s(guidString, "{%.8lX-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); return guidString; } @@ -62,7 +62,7 @@ inline GUID GuidUtil::FromString(const char* guidString) guid.Data1 = 0; guid.Data2 = 0; guid.Data3 = 0; - azsscanf(guidString, "{%8" SCNx32 "-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}", + azsscanf(guidString, "{%8lX-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}", &guid.Data1, &guid.Data2, &guid.Data3, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]); guid.Data4[0] = static_cast(d[0]); guid.Data4[1] = static_cast(d[1]); diff --git a/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/Debug/Trace_WinAPI.cpp b/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/Debug/Trace_WinAPI.cpp index 99ea10e4bc..02c1988215 100644 --- a/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/Debug/Trace_WinAPI.cpp +++ b/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/Debug/Trace_WinAPI.cpp @@ -145,7 +145,7 @@ namespace AZ char message[g_maxMessageLength]; Debug::Trace::Instance().Output(nullptr, "==================================================================\n"); - azsnprintf(message, g_maxMessageLength, "Exception : 0x%X - '%s' [%p]\n", ExceptionInfo->ExceptionRecord->ExceptionCode, GetExeptionName(ExceptionInfo->ExceptionRecord->ExceptionCode), ExceptionInfo->ExceptionRecord->ExceptionAddress); + azsnprintf(message, g_maxMessageLength, "Exception : 0x%lX - '%s' [%p]\n", ExceptionInfo->ExceptionRecord->ExceptionCode, GetExeptionName(ExceptionInfo->ExceptionRecord->ExceptionCode), ExceptionInfo->ExceptionRecord->ExceptionAddress); Debug::Trace::Instance().Output(nullptr, message); EBUS_EVENT(Debug::TraceMessageDrillerBus, OnException, message); diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/Debug/StackTracer_Windows.cpp b/Code/Framework/AzCore/Platform/Windows/AzCore/Debug/StackTracer_Windows.cpp index c4a12730ad..4558a6a3aa 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/Debug/StackTracer_Windows.cpp +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/Debug/StackTracer_Windows.cpp @@ -478,7 +478,7 @@ namespace AZ { DWORD displacement; if (g_SymGetLineFromAddr64(g_currentProcess, pc, &displacement, &line) && line.FileName[0] != 0) { - azsnprintf(textLine, textLineSize, "%s (%d) : ", line.FileName, line.LineNumber); + azsnprintf(textLine, textLineSize, "%s (%ld) : ", line.FileName, line.LineNumber); } else { diff --git a/Code/Framework/GridMate/Tests/Carrier.cpp b/Code/Framework/GridMate/Tests/Carrier.cpp index 8d3ec4eef6..9a18eb9a2c 100644 --- a/Code/Framework/GridMate/Tests/Carrier.cpp +++ b/Code/Framework/GridMate/Tests/Carrier.cpp @@ -1707,7 +1707,7 @@ TEST_F(GridMateCarrierTestFixture, Test_GetSocketErrorString) static constexpr char posixErrorWouldBlockPosixErrStr[] = "Resource temporarily unavailable"; azsnprintf(expectedBuffer.data(), expectedBuffer.size()-1 , "%s", posixErrorWouldBlockPosixErrStr); #else - azsnprintf(expectedBuffer.data(), expectedBuffer.size()-1 , "%d", AZ_EWOULDBLOCK); + azsnprintf(expectedBuffer.data(), expectedBuffer.size()-1 , "%ld", AZ_EWOULDBLOCK); #endif // !AZ_TRAIT_USE_POSIX_STRERROR_R EXPECT_STREQ(expectedBuffer.data(), socketErrorString); EXPECT_STREQ(expectedBuffer.data(), buffer.data()); diff --git a/Code/Legacy/CrySystem/DebugCallStack.cpp b/Code/Legacy/CrySystem/DebugCallStack.cpp index cdfc5de21e..bea6c8c035 100644 --- a/Code/Legacy/CrySystem/DebugCallStack.cpp +++ b/Code/Legacy/CrySystem/DebugCallStack.cpp @@ -284,7 +284,7 @@ int DebugCallStack::handleException(EXCEPTION_POINTERS* exception_pointer) char excAddr[80]; WriteLineToLog(""); sprintf_s(excAddr, "0x%04X:0x%p", exception_pointer->ContextRecord->SegCs, exception_pointer->ExceptionRecord->ExceptionAddress); - sprintf_s(excCode, "0x%08X", exception_pointer->ExceptionRecord->ExceptionCode); + sprintf_s(excCode, "0x%08lX", exception_pointer->ExceptionRecord->ExceptionCode); WriteLineToLog("Exception: %s, at Address: %s", excCode, excAddr); } @@ -445,7 +445,7 @@ void DebugCallStack::LogExceptionInfo(EXCEPTION_POINTERS* pex) else { sprintf_s(excAddr, "0x%04X:0x%p", pex->ContextRecord->SegCs, pex->ExceptionRecord->ExceptionAddress); - sprintf_s(excCode, "0x%08X", pex->ExceptionRecord->ExceptionCode); + sprintf_s(excCode, "0x%08lX", pex->ExceptionRecord->ExceptionCode); excName = TranslateExceptionCode(pex->ExceptionRecord->ExceptionCode); azstrcpy(desc, AZ_ARRAY_SIZE(desc), ""); sprintf_s(excDesc, "%s\r\n%s", excName, desc); From 2e228d94f09c4e5f50e58300146aebf0304d776a Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 20 Aug 2021 18:39:40 -0700 Subject: [PATCH 03/14] push/pop mismatch Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/TrackView/TrackViewPythonFuncs.h | 2 +- .../AzToolsFramework/Application/ToolsApplication.cpp | 2 +- .../UI/LegacyFramework/Core/EditorFrameworkApplication.cpp | 2 +- Code/Tools/SceneAPI/SceneCore/Containers/Scene.h | 2 +- Code/Tools/SceneAPI/SceneCore/Containers/SceneManifest.h | 2 +- .../SceneAPI/SceneCore/Utilities/CoordinateSystemConverter.h | 2 +- .../View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Code/Editor/TrackView/TrackViewPythonFuncs.h b/Code/Editor/TrackView/TrackViewPythonFuncs.h index 8be1bd140c..6442145ee3 100644 --- a/Code/Editor/TrackView/TrackViewPythonFuncs.h +++ b/Code/Editor/TrackView/TrackViewPythonFuncs.h @@ -35,7 +35,7 @@ namespace AzToolsFramework : public AZ::Component , public EditorLayerTrackViewRequestBus::Handler { - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING + AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING public: AZ_COMPONENT(TrackViewComponent, "{3CF943CC-6F10-4B19-88FC-CFB697558FFD}") diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp index 3e895465e5..90897090cc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp @@ -70,7 +70,7 @@ #include AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QFileInfo::d_ptr': class 'QSharedDataPointer' needs to have dll-interface to be used by clients of class 'QFileInfo' #include -AZ_POP_DISABLE_OVERRIDE_WARNING +AZ_POP_DISABLE_WARNING #include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp index 503cbc1d65..58dba5d1dd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp @@ -50,7 +50,7 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 'QFileInfo::d_ptr': class 'QSharedDataPointer' needs to have dll-interface to be used by clients of class 'QFileInfo' #include -AZ_POP_DISABLE_OVERRIDE_WARNING +AZ_POP_DISABLE_WARNING #include #include #include diff --git a/Code/Tools/SceneAPI/SceneCore/Containers/Scene.h b/Code/Tools/SceneAPI/SceneCore/Containers/Scene.h index c96ebd25e1..49320c4592 100644 --- a/Code/Tools/SceneAPI/SceneCore/Containers/Scene.h +++ b/Code/Tools/SceneAPI/SceneCore/Containers/Scene.h @@ -63,7 +63,7 @@ namespace AZ SceneGraph m_graph; SceneManifest m_manifest; SceneOrientation m_originalOrientation = SceneOrientation::YUp; - AZ_POP_DISABLE_OVERRIDE_WARNING + AZ_POP_DISABLE_WARNING }; } // Containers } // SceneAPI diff --git a/Code/Tools/SceneAPI/SceneCore/Containers/SceneManifest.h b/Code/Tools/SceneAPI/SceneCore/Containers/SceneManifest.h index 00df1bca21..4386d4fd8c 100644 --- a/Code/Tools/SceneAPI/SceneCore/Containers/SceneManifest.h +++ b/Code/Tools/SceneAPI/SceneCore/Containers/SceneManifest.h @@ -106,7 +106,7 @@ namespace AZ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") StorageLookup m_storageLookup; ValueStorage m_values; - AZ_POP_DISABLE_OVERRIDE_WARNING + AZ_POP_DISABLE_WARNING }; } // Containers } // SceneAPI diff --git a/Code/Tools/SceneAPI/SceneCore/Utilities/CoordinateSystemConverter.h b/Code/Tools/SceneAPI/SceneCore/Utilities/CoordinateSystemConverter.h index 24f7243b32..11ba8cd391 100644 --- a/Code/Tools/SceneAPI/SceneCore/Utilities/CoordinateSystemConverter.h +++ b/Code/Tools/SceneAPI/SceneCore/Utilities/CoordinateSystemConverter.h @@ -55,7 +55,7 @@ namespace AZ::SceneAPI AZ::Transform m_targetTransform; AZ::Transform m_conversionTransform; AZ::Transform m_conversionTransformInversed; - AZ_POP_DISABLE_OVERRIDE_WARNING + AZ_POP_DISABLE_WARNING AZ::u32 m_targetBasisIndices[3]; bool m_needsConversion; bool m_sourceRightHanded; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp index 7a84fc3965..a34b42bed8 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp @@ -14,7 +14,7 @@ // Disable warnings in moc code AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") #include -AZ_POP_DISABLE_OVERRIDE_WARNING +AZ_POP_DISABLE_WARNING namespace ScriptCanvasEditor { From 3eb795a305614d2b9544b31dea4eca31fa9801f4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 20 Aug 2021 18:40:20 -0700 Subject: [PATCH 04/14] alignment mismatches Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CryCommon/Cry_Camera.h | 2 +- Code/Legacy/CryCommon/IShader.h | 2 +- Code/Legacy/CryCommon/platform_impl.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Legacy/CryCommon/Cry_Camera.h b/Code/Legacy/CryCommon/Cry_Camera.h index 851611c8a6..9db4340fcb 100644 --- a/Code/Legacy/CryCommon/Cry_Camera.h +++ b/Code/Legacy/CryCommon/Cry_Camera.h @@ -2146,7 +2146,7 @@ inline uint8 CCamera::IsOBBVisible_EH(const Vec3& wpos, const OBB& obb, f32 usca //--- ADDITIONAL-TEST --- //------------------------------------------------------------------------------ -extern _MS_ALIGN(64) uint32 BoxSides[]; +extern _MS_ALIGN(64) uint32 BoxSides[] _ALIGN(64); // Description: // A box can easily straddle one of the view-frustum planes far diff --git a/Code/Legacy/CryCommon/IShader.h b/Code/Legacy/CryCommon/IShader.h index 6ae3bd73df..da7b64e96b 100644 --- a/Code/Legacy/CryCommon/IShader.h +++ b/Code/Legacy/CryCommon/IShader.h @@ -770,7 +770,7 @@ _MS_ALIGN(16) struct SSkinningData SSkinningData* pNextSkinningData; // List to the next element which needs SW-Skinning } _ALIGN(16); -struct SRenderObjData +struct _MS_ALIGN(16) SRenderObjData { uintptr_t m_uniqueObjectId; diff --git a/Code/Legacy/CryCommon/platform_impl.cpp b/Code/Legacy/CryCommon/platform_impl.cpp index ecc196a49f..a89df5471a 100644 --- a/Code/Legacy/CryCommon/platform_impl.cpp +++ b/Code/Legacy/CryCommon/platform_impl.cpp @@ -404,7 +404,7 @@ _MS_ALIGN(64) uint32 BoxSides[0x40 * 8] = { 0, 0, 0, 0, 0, 0, 0, 0, //3d 0, 0, 0, 0, 0, 0, 0, 0, //3e 0, 0, 0, 0, 0, 0, 0, 0, //3f -}; +} _ALIGN(64); //////////////////////////////////////////////////////////////////////////////////////////////////////////// #if defined(AZ_RESTRICTED_PLATFORM) From 72ff6080adfbc4da5242f44ec5ff24831d85b48b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 20 Aug 2021 18:59:12 -0700 Subject: [PATCH 05/14] format fix Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/LogFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Editor/LogFile.cpp b/Code/Editor/LogFile.cpp index 0a375882f6..a89251d52f 100644 --- a/Code/Editor/LogFile.cpp +++ b/Code/Editor/LogFile.cpp @@ -388,7 +388,7 @@ AZ_POP_DISABLE_WARNING L"(Unknown graphics card)", szLanguageBufferW, sizeof(szLanguageBufferW), L"system.ini"); AZStd::to_string(szLanguageBuffer, szLanguageBufferW); - azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, "Current display mode is %dx%dx%d, %s", + azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, "Current display mode is %ldx%ldx%ld, %s", DisplayConfig.dmPelsWidth, DisplayConfig.dmPelsHeight, DisplayConfig.dmBitsPerPel, szLanguageBuffer.c_str()); CryLog("%s", szBuffer); From 2dbac8fe2577228596102dc44a2e7bfd2cd79d5e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 20 Aug 2021 19:02:13 -0700 Subject: [PATCH 06/14] addressing comment Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- cmake/Platform/Common/MSVC/Configurations_msvc.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 7b5646cb9e..83ae51b408 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -42,7 +42,7 @@ ly_append_configurations_options( /we4296 # 'operator': expression is always false /we4426 # optimization flags changed after including header, may be due to #pragma optimize() /we4619 # #pragma warning: there is no warning number 'number' - /we4777 # 'function' : format string 'string' requires an argument of type 'type1', but variadic argument number has type 'type2' looks useful + /we4777 # 'function' : format string 'string' requires an argument of type 'type1', but variadic argument number has type 'type2 /we5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file /we5032 # detected #pragma warning(push) with no corresponding #pragma warning(pop) From 7308578e55c112f4687d8d535f50cbe6d80c4a5b Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 23 Aug 2021 14:58:47 -0700 Subject: [PATCH 07/14] reverting a change that will be cleaned by another PR Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Legacy/CryCommon/platform_impl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Legacy/CryCommon/platform_impl.cpp b/Code/Legacy/CryCommon/platform_impl.cpp index a89df5471a..13aa67ca21 100644 --- a/Code/Legacy/CryCommon/platform_impl.cpp +++ b/Code/Legacy/CryCommon/platform_impl.cpp @@ -18,6 +18,7 @@ #include #include + // Section dictionary #if defined(AZ_RESTRICTED_PLATFORM) #define PLATFORM_IMPL_H_SECTION_TRAITS 1 @@ -404,7 +405,7 @@ _MS_ALIGN(64) uint32 BoxSides[0x40 * 8] = { 0, 0, 0, 0, 0, 0, 0, 0, //3d 0, 0, 0, 0, 0, 0, 0, 0, //3e 0, 0, 0, 0, 0, 0, 0, 0, //3f -} _ALIGN(64); +}; //////////////////////////////////////////////////////////////////////////////////////////////////////////// #if defined(AZ_RESTRICTED_PLATFORM) From 63a292572097054989ea7fbb141bea3a0c26d8ce Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 23 Aug 2021 17:21:59 -0700 Subject: [PATCH 08/14] more fixes Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Math/Guid.h | 2 +- .../Windows/AzCore/PlatformIncl_Windows.h | 31 ++++++++++--------- Code/Legacy/CryCommon/platform_impl.cpp | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Math/Guid.h b/Code/Framework/AzCore/AzCore/Math/Guid.h index 53bab4d7ed..a061858265 100644 --- a/Code/Framework/AzCore/AzCore/Math/Guid.h +++ b/Code/Framework/AzCore/AzCore/Math/Guid.h @@ -22,7 +22,7 @@ typedef struct _GUID { _GUID() = default; - uint32_t Data1; + unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[ 8 ]; diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/PlatformIncl_Windows.h b/Code/Framework/AzCore/Platform/Windows/AzCore/PlatformIncl_Windows.h index f58e772155..0e798b531d 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/PlatformIncl_Windows.h +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/PlatformIncl_Windows.h @@ -34,7 +34,6 @@ ////#define NOMB //- MB_* and MessageBox() //#define NOMEMMGR //- GMEM_*, LMEM_*, GHND, LHND, associated routines //#define NOMETAFILE //- typedef METAFILEPICT -////#define NOMINMAX //- Macros min(a,b) and max(a,b) //#define NOMSG //- typedef MSG and associated routines //#define NOOPENFILE //- OpenFile(), OemToAnsi, AnsiToOem, and OF_* //#define NOSCROLL //- SB_* and scrolling routines @@ -50,27 +49,29 @@ //#define NODEFERWINDOWPOS //- DeferWindowPos routines //#define NOMCX //- Modem Configuration Extensions -// //declare intrinsics to make sure we get the inline intrinsic versions and not a function call #if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0602) -# undef _WIN32_WINNT -# define _WIN32_WINNT 0x0602 // Windows Server 2012 and later + #undef _WIN32_WINNT + #define _WIN32_WINNT 0x0602 // Windows Server 2012 and later #endif -#ifdef NOMINMAX -# include -# include -#else -# define NOMINMAX -# include -# include -# undef NOMINMAX +#if !defined(NOMINMAX) + #define NOMINMAX // - Dont define Macros min(a,b) and max(a,b) #endif + +#pragma warning(push) +#pragma warning(disable: 5032) // winioctl.h(161,17): error C5032: detected #pragma warning(push) with no corresponding #pragma warning(pop) + +#include +#include + +#pragma warning(pop) + // Undef common function names that Windows.h defines #if defined(SetJob) -#undef SetJob + #undef SetJob #endif #if defined(GetObject) -#undef GetObject + #undef GetObject #endif #if defined(GetCommandLine) -#undef GetCommandLine + #undef GetCommandLine #endif diff --git a/Code/Legacy/CryCommon/platform_impl.cpp b/Code/Legacy/CryCommon/platform_impl.cpp index 13aa67ca21..d61bfe6ee4 100644 --- a/Code/Legacy/CryCommon/platform_impl.cpp +++ b/Code/Legacy/CryCommon/platform_impl.cpp @@ -340,7 +340,7 @@ inline void CryDebugStr([[maybe_unused]] const char* format, ...) */ } -_MS_ALIGN(64) uint32 BoxSides[0x40 * 8] = { +alignas(64) uint32 BoxSides[0x40 * 8] = { 0, 0, 0, 0, 0, 0, 0, 0, //00 0, 4, 6, 2, 0, 0, 0, 4, //01 7, 5, 1, 3, 0, 0, 0, 4, //02 From a2cab41cdcb1455855fc13d9b6c0dac29ab92bd3 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:15:13 -0700 Subject: [PATCH 09/14] trying a better fix for winioctl issue Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/IO/Streamer/StreamerConfiguration_Windows.cpp | 3 +++ .../AzCore/Platform/Windows/AzCore/PlatformIncl_Windows.h | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StreamerConfiguration_Windows.cpp b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StreamerConfiguration_Windows.cpp index 0813d2d057..fe6d83b7a4 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StreamerConfiguration_Windows.cpp +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StreamerConfiguration_Windows.cpp @@ -14,6 +14,9 @@ #include #include #include + +// https://developercommunity.visualstudio.com/t/windows-sdk-100177630-pragma-push-pop-mismatch-in/386142 +#define _NTDDSCM_H_ #include namespace AZ::IO diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/PlatformIncl_Windows.h b/Code/Framework/AzCore/Platform/Windows/AzCore/PlatformIncl_Windows.h index 0e798b531d..8563dc9251 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/PlatformIncl_Windows.h +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/PlatformIncl_Windows.h @@ -57,14 +57,9 @@ #define NOMINMAX // - Dont define Macros min(a,b) and max(a,b) #endif -#pragma warning(push) -#pragma warning(disable: 5032) // winioctl.h(161,17): error C5032: detected #pragma warning(push) with no corresponding #pragma warning(pop) - #include #include -#pragma warning(pop) - // Undef common function names that Windows.h defines #if defined(SetJob) #undef SetJob From 0f3381a7a7e89b24cb5fcc11bff09f2b1b51e36e Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 24 Aug 2021 11:13:04 -0700 Subject: [PATCH 10/14] required warning to disable until we get to the right MSVC version Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- cmake/Platform/Common/MSVC/Configurations_msvc.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 83ae51b408..41fa9cbb5b 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -36,6 +36,7 @@ ly_append_configurations_options( # Disabling some warnings /wd4201 # nonstandard extension used: nameless struct/union. This actually became part of the C++11 std, MS has an open issue: https://developercommunity.visualstudio.com/t/warning-level-4-generates-a-bogus-warning-c4201-no/103064 + /wd4619 # unknown #pragma warning. Unfortunately some versions of MSVC 16.X dont filter this warning coming from external headers and Qt has a bad warning in QtCore/qvector.h(340,12) # Enabling warnings that are disabled by default from /W4 # https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019 From d7fda783a82eee5baa5a5e1bcf066428cc051286 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 24 Aug 2021 11:48:49 -0700 Subject: [PATCH 11/14] improves comment Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- cmake/Platform/Common/MSVC/Configurations_msvc.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 41fa9cbb5b..7ee118e2f4 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -36,7 +36,7 @@ ly_append_configurations_options( # Disabling some warnings /wd4201 # nonstandard extension used: nameless struct/union. This actually became part of the C++11 std, MS has an open issue: https://developercommunity.visualstudio.com/t/warning-level-4-generates-a-bogus-warning-c4201-no/103064 - /wd4619 # unknown #pragma warning. Unfortunately some versions of MSVC 16.X dont filter this warning coming from external headers and Qt has a bad warning in QtCore/qvector.h(340,12) + /wd4619 # #pragma warning : there is no warning number 'number'. Unfortunately some versions of MSVC 16.X dont filter this warning coming from external headers and Qt has a bad warning in QtCore/qvector.h(340,12) # Enabling warnings that are disabled by default from /W4 # https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019 From f22ecc783028fcce46670d3684aecb9ac975fc40 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 24 Aug 2021 15:15:40 -0700 Subject: [PATCH 12/14] of course, was disabling/enabling the warning Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- cmake/Platform/Common/MSVC/Configurations_msvc.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 7ee118e2f4..3a108cec4c 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -36,13 +36,12 @@ ly_append_configurations_options( # Disabling some warnings /wd4201 # nonstandard extension used: nameless struct/union. This actually became part of the C++11 std, MS has an open issue: https://developercommunity.visualstudio.com/t/warning-level-4-generates-a-bogus-warning-c4201-no/103064 - /wd4619 # #pragma warning : there is no warning number 'number'. Unfortunately some versions of MSVC 16.X dont filter this warning coming from external headers and Qt has a bad warning in QtCore/qvector.h(340,12) # Enabling warnings that are disabled by default from /W4 # https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019 /we4296 # 'operator': expression is always false /we4426 # optimization flags changed after including header, may be due to #pragma optimize() - /we4619 # #pragma warning: there is no warning number 'number' + #/we4619 # #pragma warning: there is no warning number 'number'. Unfortunately some versions of MSVC 16.X dont filter this warning coming from external headers and Qt has a bad warning in QtCore/qvector.h(340,12) /we4777 # 'function' : format string 'string' requires an argument of type 'type1', but variadic argument number has type 'type2 /we5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file /we5032 # detected #pragma warning(push) with no corresponding #pragma warning(pop) From e2acd66c46400aa058497ec70f92b1241da36b69 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 25 Aug 2021 11:37:35 -0700 Subject: [PATCH 13/14] Fixes Guid formatting Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/Util/GuidUtil.h | 4 ++-- Code/Framework/AzCore/AzCore/Math/Guid.h | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Code/Editor/Util/GuidUtil.h b/Code/Editor/Util/GuidUtil.h index c53589b6ca..de2bad8759 100644 --- a/Code/Editor/Util/GuidUtil.h +++ b/Code/Editor/Util/GuidUtil.h @@ -48,7 +48,7 @@ inline bool GuidUtil::IsEmpty(REFGUID guid) inline const char* GuidUtil::ToString(REFGUID guid) { static char guidString[64]; - sprintf_s(guidString, "{%.8lX-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], + sprintf_s(guidString, "{%.8" GUID_FORMAT_DATA1 "-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); return guidString; } @@ -62,7 +62,7 @@ inline GUID GuidUtil::FromString(const char* guidString) guid.Data1 = 0; guid.Data2 = 0; guid.Data3 = 0; - azsscanf(guidString, "{%8lX-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}", + azsscanf(guidString, "{%8" GUID_FORMAT_DATA1 "-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}", &guid.Data1, &guid.Data2, &guid.Data3, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]); guid.Data4[0] = static_cast(d[0]); guid.Data4[1] = static_cast(d[1]); diff --git a/Code/Framework/AzCore/AzCore/Math/Guid.h b/Code/Framework/AzCore/AzCore/Math/Guid.h index a061858265..b1cd91716b 100644 --- a/Code/Framework/AzCore/AzCore/Math/Guid.h +++ b/Code/Framework/AzCore/AzCore/Math/Guid.h @@ -8,7 +8,9 @@ #ifndef AZ_CORE_GUID_H #define AZ_CORE_GUID_H 1 -#ifndef GUID_DEFINED +#if defined(GUID_DEFINED) +#define GUID_FORMAT_DATA1 "lX" +#else #define GUID_DEFINED typedef struct _GUID { _GUID(unsigned long d1, unsigned short d2, unsigned short d3, std::initializer_list d4) @@ -22,11 +24,12 @@ typedef struct _GUID { _GUID() = default; - unsigned long Data1; + uint32_t Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[ 8 ]; } GUID; +#define GUID_FORMAT_DATA1 "X" #endif // GUID_DEFINED #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_ From 4a05d6f7ec54d4b666019087f3de81aa781a7662 Mon Sep 17 00:00:00 2001 From: Jeremy Ong Date: Wed, 25 Aug 2021 14:06:47 -0600 Subject: [PATCH 14/14] Add CMakeUserPresets.json file to gitignore Signed-off-by: Jeremy Ong --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b73c89b1d9..c28f6ab123 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__ AssetProcessorTemp/** [Bb]uild/** [Oo]ut/** +CMakeUserPresets.json [Cc]ache/ /install/ Editor/EditorEventLog.xml