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. --- buffer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'buffer.h') diff --git a/buffer.h b/buffer.h index 91932c6..41c2532 100644 --- a/buffer.h +++ b/buffer.h @@ -43,9 +43,9 @@ bool buffer_prepend(Buffer*, const void *data, size_t len); /* prepend NUL-terminated data */ bool buffer_prepend0(Buffer*, const char *data); /* set formatted buffer content, ensures NUL termination on success */ -bool buffer_printf(Buffer*, const char *fmt, ...); +bool buffer_printf(Buffer*, const char *fmt, ...) __attribute__((format(printf, 2, 3))); /* append formatted buffer content, ensures NUL termination on success */ -bool buffer_appendf(Buffer*, const char *fmt, ...); +bool buffer_appendf(Buffer*, const char *fmt, ...) __attribute__((format(printf, 2, 3))); /* return length of a buffer without trailing NUL byte */ size_t buffer_length0(Buffer*); /* return length of a buffer including possible NUL byte */ -- cgit v1.2.3