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;
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();

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

@ -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

@ -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);
}
//////////////////////////////////////////////////////////////////////////

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

@ -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__);

@ -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());
}
}

@ -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<uint32_t>(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();
}

@ -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

Loading…
Cancel
Save