diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-12-22 16:36:06 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-12-23 19:41:41 +0100 |
| commit | e28459d8836810a1ea057ff2d47f223fb4f110e5 (patch) | |
| tree | fe8587ee43f6e23793457a529416b779e578bc4c /text.h | |
| parent | 58001e979af57701e36c58e0b36ea5f79246b012 (diff) | |
| download | vis-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 'text.h')
| -rw-r--r-- | text.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |
