diff th_ioctx.h @ 570:262411458cde

Add __attribute__(__format__ ..) specifiers for functions that use printf() style format specifiers.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 09 Jan 2020 13:36:41 +0200
parents 3a852e9f70a6
children 70d44ba005ac
line wrap: on
line diff
--- a/th_ioctx.h	Wed Jan 08 02:36:42 2020 +0200
+++ b/th_ioctx.h	Thu Jan 09 13:36:41 2020 +0200
@@ -89,8 +89,10 @@
 
 int          th_io_error_v(th_ioctx *ctx, const int err, const char *fmt, va_list ap);
 void         th_io_msg_v(th_ioctx *ctx, const int level, const char *fmt, va_list ap);
-int          th_io_error(th_ioctx *ctx, const int err, const char *fmt, ...);
-void         th_io_msg(th_ioctx *ctx, const int level, const char *fmt, ...);
+int          th_io_error(th_ioctx *ctx, const int err, const char *fmt, ...)
+             __attribute__ ((__format__ (__printf__, 3, 4)));
+void         th_io_msg(th_ioctx *ctx, const int level, const char *fmt, ...)
+             __attribute__ ((__format__ (__printf__, 3, 4)));
 
 
 //
@@ -109,7 +111,8 @@
 char *       thfgets(char *ptr, int size, th_ioctx *ctx);
 int          thfputs(const char *ptr, th_ioctx *ctx);
 int          thvfprintf(th_ioctx *ctx, const char *fmt, va_list ap);
-int          thfprintf(th_ioctx *ctx, const char *fmt, ...);
+int          thfprintf(th_ioctx *ctx, const char *fmt, ...)
+             __attribute__ ((__format__ (__printf__, 2, 3)));
 
 int          thfread_str(th_ioctx *ctx, void *ptr, const size_t len);
 BOOL         thfread_u8(th_ioctx *ctx, uint8_t *);