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 diff --git a/Code/Editor/LogFile.cpp b/Code/Editor/LogFile.cpp index 62e39c8f8a..92186901d7 100644 --- a/Code/Editor/LogFile.cpp +++ b/Code/Editor/LogFile.cpp @@ -286,7 +286,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; ////////////////////////////////////////////////////////////////////// @@ -337,7 +337,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 @@ -387,7 +387,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); 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/Editor/Util/GuidUtil.h b/Code/Editor/Util/GuidUtil.h index 9952d6b4ed..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, "{%.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, "{%.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, "{%8" SCNx32 "-%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 3a2db1693f..325866dad5 100644 --- a/Code/Framework/AzCore/AzCore/Math/Guid.h +++ b/Code/Framework/AzCore/AzCore/Math/Guid.h @@ -8,18 +8,21 @@ #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 #include struct _GUID { - uint32_t Data1; + uint32_t Data1; unsigned short Data2; unsigned short Data3; AZStd::array Data4; }; using GUID = _GUID; +#define GUID_FORMAT_DATA1 "X" #endif // GUID_DEFINED #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_ 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 f8f94ea2b3..b2a1410bf5 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/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 f58e772155..8563dc9251 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,24 @@ //#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 + +#include +#include + // 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/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp index ba9a659ba4..a3a79402ad 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 5b2638da1e..33562421e9 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp @@ -48,7 +48,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/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/CryCommon/platform_impl.cpp b/Code/Legacy/CryCommon/platform_impl.cpp index 168b5fd253..d61bfe6ee4 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 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); 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 { diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 7a66f397c5..7c7120fe15 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -41,13 +41,11 @@ ly_append_configurations_options( # https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019 /we4296 # 'operator': expression is always false /we5233 # explicit lambda capture 'identifier' is not used - - # /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'. 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) /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.