enabling warn format security and some fixes

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
monroegm-disable-blank-issue-2
Esteban Papp 4 years ago
parent cdcdcb0777
commit 0df55c3a7f

@ -78,7 +78,7 @@ bool CMemoryBlock::Allocate(int size, int uncompressedSize)
{ {
QString str; QString str;
str = QStringLiteral("CMemoryBlock::Allocate failed to allocate %1Mb of Memory").arg(size / (1024 * 1024)); 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.")); 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(); GetIEditor()->ReduceMemory();

@ -150,7 +150,7 @@ namespace AzManipulatorTestFramework
template <typename DerivedDispatcherT> template <typename DerivedDispatcherT>
DerivedDispatcherT* ActionDispatcher<DerivedDispatcherT>::MouseLButtonDown() DerivedDispatcherT* ActionDispatcher<DerivedDispatcherT>::MouseLButtonDown()
{ {
Log("Mouse left button down"); Log("%s", "Mouse left button down");
MouseLButtonDownImpl(); MouseLButtonDownImpl();
return static_cast<DerivedDispatcherT*>(this); return static_cast<DerivedDispatcherT*>(this);
} }
@ -158,7 +158,7 @@ namespace AzManipulatorTestFramework
template <typename DerivedDispatcherT> template <typename DerivedDispatcherT>
DerivedDispatcherT* ActionDispatcher<DerivedDispatcherT>::MouseLButtonUp() DerivedDispatcherT* ActionDispatcher<DerivedDispatcherT>::MouseLButtonUp()
{ {
Log("Mouse left button up"); Log("%s", "Mouse left button up");
MouseLButtonUpImpl(); MouseLButtonUpImpl();
return static_cast<DerivedDispatcherT*>(this); return static_cast<DerivedDispatcherT*>(this);
} }

@ -24,7 +24,7 @@ namespace AzManipulatorTestFramework
{ {
const char* error = "Couldn't add action to sequence, dispatcher is locked (you must call ResetSequence() \ const char* error = "Couldn't add action to sequence, dispatcher is locked (you must call ResetSequence() \
before adding actions to this dispatcher)"; before adding actions to this dispatcher)";
Log(error); Log("%s", error);
AZ_Assert(false, "Error: %s", error); AZ_Assert(false, "Error: %s", error);
} }
@ -108,7 +108,7 @@ namespace AzManipulatorTestFramework
RetainedModeActionDispatcher* RetainedModeActionDispatcher::ResetSequence() RetainedModeActionDispatcher* RetainedModeActionDispatcher::ResetSequence()
{ {
Log("Resetting the action sequence"); Log("%s", "Resetting the action sequence");
m_actions.clear(); m_actions.clear();
m_dispatcher.ResetEvent(); m_dispatcher.ResetEvent();
m_locked = false; m_locked = false;
@ -117,7 +117,7 @@ namespace AzManipulatorTestFramework
RetainedModeActionDispatcher* RetainedModeActionDispatcher::Execute() RetainedModeActionDispatcher* RetainedModeActionDispatcher::Execute()
{ {
Log("Executing %u actions", m_actions.size()); Log("%s", "Executing %u actions", m_actions.size());
for (auto& action : m_actions) for (auto& action : m_actions)
{ {
action(); action();

@ -824,9 +824,7 @@ void CLevelSystem::LogLoadingTime()
sChain = " (Chained)"; sChain = " (Chained)";
} }
AZStd::string text; gEnv->pLog->Log("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain);
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());
} }
void CLevelSystem::GetMemoryUsage(ICrySizer* pSizer) const void CLevelSystem::GetMemoryUsage(ICrySizer* pSizer) const

@ -468,10 +468,7 @@ namespace LegacyLevelSystem
sChain = " (Chained)"; sChain = " (Chained)";
} }
AZStd::string text; gEnv->pLog->Log("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain);
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());
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////

@ -593,11 +593,11 @@ void CLog::LogPlus(const char* szFormat, ...)
if (bfile) if (bfile)
{ {
LogToFilePlus(szTemp); LogToFilePlus("%s", szTemp);
} }
if (bconsole) if (bconsole)
{ {
LogToConsolePlus(szTemp); LogToConsolePlus("%s", szTemp);
} }
} }

@ -190,7 +190,7 @@ void CSystem::LogVersion()
#else #else
strftime(s, 128, "Log Started at %c", today); strftime(s, 128, "Log Started at %c", today);
#endif #endif
CryLogAlways(s); CryLogAlways("%s", s);
CryLogAlways("Built on " __DATE__ " " __TIME__); CryLogAlways("Built on " __DATE__ " " __TIME__);

@ -376,12 +376,12 @@ void CXConsole::LogChangeMessage(const char* name, const bool isConst, const boo
if (allowChange) 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!"); gEnv->pLog->LogWarning("Modifying marked variables will not be allowed in Release mode!");
} }
else else
{ {
gEnv->pLog->LogError(logMessage.c_str()); gEnv->pLog->LogError("%s", logMessage.c_str());
} }
} }

@ -200,7 +200,7 @@ namespace AssetMemoryAnalyzer
switch (ap->m_codePoint->m_category) switch (ap->m_codePoint->m_category)
{ {
case AllocationCategories::HEAP: case AllocationCategories::HEAP:
ImGui::Text(FormatUtils::FormatCodePoint(*ap->m_codePoint)); ImGui::Text("%s", FormatUtils::FormatCodePoint(*ap->m_codePoint));
heapSummary.m_allocationCount = static_cast<uint32_t>(ap->m_allocations.size()); heapSummary.m_allocationCount = static_cast<uint32_t>(ap->m_allocations.size());
heapSummary.m_allocatedMemory = ap->m_totalAllocatedMemory; heapSummary.m_allocatedMemory = ap->m_totalAllocatedMemory;
break; break;
@ -247,7 +247,7 @@ namespace AssetMemoryAnalyzer
{ {
if (text) if (text)
{ {
ImGui::Text(text); ImGui::Text("%s", text);
ImGui::SameLine(); ImGui::SameLine();
} }

@ -22,7 +22,6 @@ ly_append_configurations_options(
"-Wno-#pragma-messages" "-Wno-#pragma-messages"
-Wno-absolute-value -Wno-absolute-value
-Wno-dynamic-class-memaccess -Wno-dynamic-class-memaccess
-Wno-format-security
-Wno-inconsistent-missing-override -Wno-inconsistent-missing-override
-Wno-invalid-offsetof -Wno-invalid-offsetof
-Wno-multichar -Wno-multichar

Loading…
Cancel
Save