1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:47:45 +00:00

LibC+Utilities: Add gnu::format attributes

Without these attributes present on these custom formatting functions,
Clang would warn use about nonliteral format strings. As an added bonus,
we now get type checking on these.
This commit is contained in:
Daniel Bertalan 2021-07-06 06:29:49 +02:00 committed by Gunnar Beutner
parent e8e628de57
commit 98260c5862
2 changed files with 2 additions and 2 deletions

View file

@ -22,7 +22,7 @@ char* optarg = nullptr;
// processed". Well, this is how we do it.
static size_t s_index_into_multioption_argument = 0;
static inline void report_error(const char* format, ...)
[[gnu::format(printf, 1, 2)]] static inline void report_error(const char* format, ...)
{
if (!opterr)
return;