diff --git a/AK/String.h b/AK/String.h index 6d1af1945e7..3582e54ce3b 100644 --- a/AK/String.h +++ b/AK/String.h @@ -244,7 +244,7 @@ public: return String((const char*)buffer.data(), buffer.size(), should_chomp); } - static String format(const char*, ...); + static String format(const char*, ...) __attribute__((format(printf, 1, 2))); static String vformatted(StringView fmtstr, TypeErasedFormatParams); diff --git a/AK/StringBuilder.h b/AK/StringBuilder.h index d313c9147de..e791dbf5321 100644 --- a/AK/StringBuilder.h +++ b/AK/StringBuilder.h @@ -46,7 +46,7 @@ public: void append(char); void append_code_point(u32); void append(const char*, size_t); - void appendf(const char*, ...); + void appendf(const char*, ...) __attribute__((format(printf, 2, 3))); void appendvf(const char*, va_list); void append_escaped_for_json(const StringView&);