Common: Validate the number of {} fields in format strings

Unfortunately, {fmt} allows passing too many arguments to a format call
without raising any runtime or compile-time error [1].

As this is a common source of bugs since we started migrating to {fmt},
this commit adds some custom logic to validate the number of
replacement fields in format strings in addition to {fmt}'s own checks.

[1] https://github.com/fmtlib/fmt/issues/492
This commit is contained in:
Léo Lam committed 2020-11-19 17:09:24 +01:00
1 parent 47c91696ee
commit 62eeb05519
5 files changed
+58 -4

No files matched your search

+2 -1
View File
@@ -58,6 +58,7 @@
<ClInclude Include="FileUtil.h" />
<ClInclude Include="FixedSizeQueue.h" />
<ClInclude Include="Flag.h" />
<ClInclude Include="FormatUtil.h" />
<ClInclude Include="FPURoundMode.h" />
<ClInclude Include="GekkoDisassembler.h" />
<ClInclude Include="GL\GLExtensions\AMD_pinned_memory.h" />
@@ -283,4 +284,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>