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
commit 98260c5862
Notes: sideshowbarker 2024-07-18 10:05:48 +09:00
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@
bool g_there_was_an_error = false;
[[noreturn]] static void fatal_error(const char* format, ...)
[[noreturn, gnu::format(printf, 1, 2)]] static void fatal_error(const char* format, ...)
{
fputs("\033[31m", stderr);