From 98260c586216909934abfe63beeebff3171f4479 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Tue, 6 Jul 2021 06:29:49 +0200 Subject: 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. --- Userland/Utilities/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Utilities/test.cpp') diff --git a/Userland/Utilities/test.cpp b/Userland/Utilities/test.cpp index a868348411..f662c8d259 100644 --- a/Userland/Utilities/test.cpp +++ b/Userland/Utilities/test.cpp @@ -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); -- cgit v1.2.3