From e28459d8836810a1ea057ff2d47f223fb4f110e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 22 Dec 2016 16:36:06 +0100 Subject: Apply format string attribute to printf style functions Not strictly C99 conform, but widely supported and easy enough to NOP for compilers which do not support it. Besides it was already used to mark certain functions as noreturn. --- text.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'text.h') diff --git a/text.h b/text.h index 8f41f08..b927e3f 100644 --- a/text.h +++ b/text.h @@ -40,8 +40,8 @@ typedef struct { Text *text_load(const char *filename); /* file information at time of load or last save */ struct stat text_stat(Text*); -bool text_appendf(Text*, const char *format, ...); -bool text_printf(Text*, size_t pos, const char *format, ...); +bool text_appendf(Text*, const char *format, ...) __attribute__((format(printf, 2, 3))); +bool text_printf(Text*, size_t pos, const char *format, ...) __attribute__((format(printf, 3, 4))); /* inserts a line ending character (depending on file type) */ size_t text_insert_newline(Text*, size_t pos); /* insert `len' bytes starting from `data' at `pos' which has to be -- cgit v1.2.3