aboutsummaryrefslogtreecommitdiff
path: root/buffer.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-12-22 16:36:06 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-12-23 19:41:41 +0100
commite28459d8836810a1ea057ff2d47f223fb4f110e5 (patch)
treefe8587ee43f6e23793457a529416b779e578bc4c /buffer.h
parent58001e979af57701e36c58e0b36ea5f79246b012 (diff)
downloadvis-e28459d8836810a1ea057ff2d47f223fb4f110e5.tar.gz
vis-e28459d8836810a1ea057ff2d47f223fb4f110e5.tar.xz
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.
Diffstat (limited to 'buffer.h')
-rw-r--r--buffer.h4
1 files changed, 2 insertions, 2 deletions
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 */