From 1af202370e38a1bbdac5d8619bfa580188a0b802 Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Tue, 8 Oct 2019 11:00:59 +0300 Subject: diagnostic: tag functions as printf-style. This allows the compiler to check the format string and give warnings accordingly. Signed-off-by: Gediminas Jakutis --- include/rin/diagnostic.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/rin/diagnostic.h') diff --git a/include/rin/diagnostic.h b/include/rin/diagnostic.h index de925cc..128e059 100644 --- a/include/rin/diagnostic.h +++ b/include/rin/diagnostic.h @@ -21,6 +21,7 @@ #ifndef LIBRIN_DIAGNOSTIC_INCLUDED #define LIBRIN_DIAGNOSTIC_INCLUDED +#include "rin/definitions.h" #include #define RIN_DIAG_SET 1 @@ -42,9 +43,9 @@ enum rin_diag_outstream { int rin_diag_flags(int flag, int action); int rin_diag_set_outstream(enum rin_diag_outstream channel, FILE *stream); -void rin_err(const char *format, ...); -void rin_fixme(const char *format, ...); -void rin_warn(const char *format, ...); -void rin_info(const char *format, ...); +void rin_err(const char *format, ...) FORMAT_STRING(1, 2); +void rin_fixme(const char *format, ...) FORMAT_STRING(1, 2); +void rin_warn(const char *format, ...) FORMAT_STRING(1, 2); +void rin_info(const char *format, ...) FORMAT_STRING(1, 2); #endif /* LIBRIN_DIAGNOSTIC_INCLUDED */ -- cgit v1.2.3