From 1400e93b6dc749d9f7210d657a70670a6647a684 Mon Sep 17 00:00:00 2001 From: Quinn Date: Thu, 22 Jan 2026 12:22:22 +0100 Subject: [PATCH] Add format specifiers for logging macros. --- src/util/error.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/util/error.h b/src/util/error.h index 11d09f9..3c53928 100644 --- a/src/util/error.h +++ b/src/util/error.h @@ -10,11 +10,21 @@ #include #include +FORMAT((printf, 3, 4)) void error_debug(uint ln, const char *restrict file, const char *restrict fmt, ...); + +FORMAT((printf, 3, 4)) void error_info(uint ln, const char *restrict file, const char *restrict fmt, ...); + +FORMAT((printf, 3, 4)) void error_warn(uint ln, const char *restrict file, const char *restrict fmt, ...); + +FORMAT((printf, 3, 4)) void error_error(uint ln, const char *restrict file, const char *restrict fmt, ...); -void error_fatal(uint ln, const char *restrict file, const char *restrict fmt, ...) NORET; + +NORET +FORMAT((printf, 3, 4)) +void error_fatal(uint ln, const char *restrict file, const char *restrict fmt, ...); #define debug(...) error_debug(__LINE__, __FILE__, __VA_ARGS__) #define info(...) error_info(__LINE__, __FILE__, __VA_ARGS__)