1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:17:35 +00:00

AK+Kernel+Userland: Enable some more compiletime format string checks

This enables format string checks for three more functions:
- String::formatted()
- Builder::appendff()
- KBufferBuilder::appendff()
This commit is contained in:
AnotherTest 2021-02-23 09:58:15 +03:30 committed by Andreas Kling
parent c989e55195
commit 7c2754c3a6
6 changed files with 24 additions and 17 deletions

View file

@ -49,11 +49,11 @@ public:
void append_bytes(ReadonlyBytes);
template<typename... Parameters>
void appendff(StringView fmtstr, const Parameters&... parameters)
void appendff(CheckedFormatString<Parameters...>&& fmtstr, const Parameters&... parameters)
{
// FIXME: This is really not the way to go about it, but vformat expects a
// StringBuilder. Why does this class exist anyways?
append(String::formatted(fmtstr, parameters...));
append(String::formatted(fmtstr.view(), parameters...));
}
bool flush();