diff --git a/Code/Editor/Util/MemoryBlock.cpp b/Code/Editor/Util/MemoryBlock.cpp index e840a1735e..b7ae017113 100644 --- a/Code/Editor/Util/MemoryBlock.cpp +++ b/Code/Editor/Util/MemoryBlock.cpp @@ -78,7 +78,7 @@ bool CMemoryBlock::Allocate(int size, int uncompressedSize) { QString str; str = QStringLiteral("CMemoryBlock::Allocate failed to allocate %1Mb of Memory").arg(size / (1024 * 1024)); - CryLogAlways(str.toUtf8().data()); + CryLogAlways("%s", str.toUtf8().data()); QMessageBox::critical(QApplication::activeWindow(), QString(), str + QString("\r\nSandbox will try to reduce its working memory set to free memory for this allocation.")); GetIEditor()->ReduceMemory(); diff --git a/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ActionDispatcher.h b/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ActionDispatcher.h index 11ed31e864..523e6a30a7 100644 --- a/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ActionDispatcher.h +++ b/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ActionDispatcher.h @@ -150,7 +150,7 @@ namespace AzManipulatorTestFramework template DerivedDispatcherT* ActionDispatcher::MouseLButtonDown() { - Log("Mouse left button down"); + Log("%s", "Mouse left button down"); MouseLButtonDownImpl(); return static_cast(this); } @@ -158,7 +158,7 @@ namespace AzManipulatorTestFramework template DerivedDispatcherT* ActionDispatcher::MouseLButtonUp() { - Log("Mouse left button up"); + Log("%s", "Mouse left button up"); MouseLButtonUpImpl(); return static_cast(this); } diff --git a/Code/Framework/AzManipulatorTestFramework/Source/RetainedModeActionDispatcher.cpp b/Code/Framework/AzManipulatorTestFramework/Source/RetainedModeActionDispatcher.cpp index ca08142371..8f82bb09b1 100644 --- a/Code/Framework/AzManipulatorTestFramework/Source/RetainedModeActionDispatcher.cpp +++ b/Code/Framework/AzManipulatorTestFramework/Source/RetainedModeActionDispatcher.cpp @@ -24,7 +24,7 @@ namespace AzManipulatorTestFramework { const char* error = "Couldn't add action to sequence, dispatcher is locked (you must call ResetSequence() \ before adding actions to this dispatcher)"; - Log(error); + Log("%s", error); AZ_Assert(false, "Error: %s", error); } @@ -108,7 +108,7 @@ namespace AzManipulatorTestFramework RetainedModeActionDispatcher* RetainedModeActionDispatcher::ResetSequence() { - Log("Resetting the action sequence"); + Log("%s", "Resetting the action sequence"); m_actions.clear(); m_dispatcher.ResetEvent(); m_locked = false; @@ -117,7 +117,7 @@ namespace AzManipulatorTestFramework RetainedModeActionDispatcher* RetainedModeActionDispatcher::Execute() { - Log("Executing %u actions", m_actions.size()); + Log("%s", "Executing %u actions", m_actions.size()); for (auto& action : m_actions) { action(); diff --git a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp index fe87c3f784..d5ef2dd3b8 100644 --- a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp @@ -824,9 +824,7 @@ void CLevelSystem::LogLoadingTime() sChain = " (Chained)"; } - AZStd::string text; - text.format("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain); - gEnv->pLog->Log(text.c_str()); + gEnv->pLog->Log("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain); } void CLevelSystem::GetMemoryUsage(ICrySizer* pSizer) const diff --git a/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp index 72d74ea1c1..a82c4a6914 100644 --- a/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp @@ -468,10 +468,7 @@ namespace LegacyLevelSystem sChain = " (Chained)"; } - AZStd::string text; - text.format( - "Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain); - gEnv->pLog->Log(text.c_str()); + gEnv->pLog->Log("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain); } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Legacy/CrySystem/Log.cpp b/Code/Legacy/CrySystem/Log.cpp index 68b9621f74..c08d5870e9 100644 --- a/Code/Legacy/CrySystem/Log.cpp +++ b/Code/Legacy/CrySystem/Log.cpp @@ -593,11 +593,11 @@ void CLog::LogPlus(const char* szFormat, ...) if (bfile) { - LogToFilePlus(szTemp); + LogToFilePlus("%s", szTemp); } if (bconsole) { - LogToConsolePlus(szTemp); + LogToConsolePlus("%s", szTemp); } } diff --git a/Code/Legacy/CrySystem/SystemCFG.cpp b/Code/Legacy/CrySystem/SystemCFG.cpp index 0f67fdc2e1..b6b664f62d 100644 --- a/Code/Legacy/CrySystem/SystemCFG.cpp +++ b/Code/Legacy/CrySystem/SystemCFG.cpp @@ -190,7 +190,7 @@ void CSystem::LogVersion() #else strftime(s, 128, "Log Started at %c", today); #endif - CryLogAlways(s); + CryLogAlways("%s", s); CryLogAlways("Built on " __DATE__ " " __TIME__); diff --git a/Code/Legacy/CrySystem/XConsole.cpp b/Code/Legacy/CrySystem/XConsole.cpp index bb8316981a..1677cb06a5 100644 --- a/Code/Legacy/CrySystem/XConsole.cpp +++ b/Code/Legacy/CrySystem/XConsole.cpp @@ -376,12 +376,12 @@ void CXConsole::LogChangeMessage(const char* name, const bool isConst, const boo if (allowChange) { - gEnv->pLog->LogWarning(logMessage.c_str()); + gEnv->pLog->LogWarning("%s", logMessage.c_str()); gEnv->pLog->LogWarning("Modifying marked variables will not be allowed in Release mode!"); } else { - gEnv->pLog->LogError(logMessage.c_str()); + gEnv->pLog->LogError("%s", logMessage.c_str()); } } diff --git a/Gems/AssetMemoryAnalyzer/Code/Source/DebugImGUI.cpp b/Gems/AssetMemoryAnalyzer/Code/Source/DebugImGUI.cpp index aecac5fa34..c9c123cf70 100644 --- a/Gems/AssetMemoryAnalyzer/Code/Source/DebugImGUI.cpp +++ b/Gems/AssetMemoryAnalyzer/Code/Source/DebugImGUI.cpp @@ -200,7 +200,7 @@ namespace AssetMemoryAnalyzer switch (ap->m_codePoint->m_category) { case AllocationCategories::HEAP: - ImGui::Text(FormatUtils::FormatCodePoint(*ap->m_codePoint)); + ImGui::Text("%s", FormatUtils::FormatCodePoint(*ap->m_codePoint)); heapSummary.m_allocationCount = static_cast(ap->m_allocations.size()); heapSummary.m_allocatedMemory = ap->m_totalAllocatedMemory; break; @@ -247,7 +247,7 @@ namespace AssetMemoryAnalyzer { if (text) { - ImGui::Text(text); + ImGui::Text("%s", text); ImGui::SameLine(); } diff --git a/cmake/Platform/Common/Clang/Configurations_clang.cmake b/cmake/Platform/Common/Clang/Configurations_clang.cmake index 17a89fc1cd..dbaf9b0bf0 100644 --- a/cmake/Platform/Common/Clang/Configurations_clang.cmake +++ b/cmake/Platform/Common/Clang/Configurations_clang.cmake @@ -22,7 +22,6 @@ ly_append_configurations_options( "-Wno-#pragma-messages" -Wno-absolute-value -Wno-dynamic-class-memaccess - -Wno-format-security -Wno-inconsistent-missing-override -Wno-invalid-offsetof -Wno-multichar