Add BOZO_PRINTFLIKE for functions that pass an argument and va_arg to

a vprintf-like function.
This commit is contained in:
joerg 2012-03-14 23:47:19 +00:00
parent 90310d68b0
commit 62451b58c9
2 changed files with 12 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bozohttpd.h,v 1.21 2012/02/20 09:26:56 elric Exp $ */
/* $NetBSD: bozohttpd.h,v 1.22 2012/03/14 23:47:19 joerg Exp $ */
/* $eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $ */
@ -164,19 +164,18 @@ typedef struct bozoprefs_t {
#define strornull(x) ((x) ? (x) : "<null>")
#ifndef NO_DEBUG
void debug__(bozohttpd_t *, int, const char *, ...)
__attribute__((__format__(__printf__, 3, 4)));
#define debug(x) debug__ x
#else
#define debug(x)
#endif /* NO_DEBUG */
#if defined(__GNUC__) && __GNUC__ >= 3
#define BOZO_PRINTFLIKE(x,y) __attribute__((__format__(__printf__, x,y)))
#define BOZO_DEAD __attribute__((__noreturn__))
#endif
#ifndef NO_DEBUG
void debug__(bozohttpd_t *, int, const char *, ...) BOZO_PRINTFLIKE(3, 4);
#define debug(x) debug__ x
#else
#define debug(x)
#endif /* NO_DEBUG */
void bozo_warn(bozohttpd_t *, const char *, ...)
BOZO_PRINTFLIKE(2, 3);
void bozo_err(bozohttpd_t *, int, const char *, ...)
@ -278,7 +277,7 @@ void bozo_add_content_map_mime(bozohttpd_t *, const char *, const char *, const
#endif
/* I/O */
int bozo_printf(bozohttpd_t *, const char *, ...);
int bozo_printf(bozohttpd_t *, const char *, ...) BOZO_PRINTFLIKE(2, 3);;
ssize_t bozo_read(bozohttpd_t *, int, void *, size_t);
ssize_t bozo_write(bozohttpd_t *, int, const void *, size_t);
int bozo_flush(bozohttpd_t *, FILE *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ssl-bozo.c,v 1.14 2012/02/20 08:40:46 elric Exp $ */
/* $NetBSD: ssl-bozo.c,v 1.15 2012/03/14 23:47:19 joerg Exp $ */
/* $eterna: ssl-bozo.c,v 1.15 2011/11/18 09:21:15 mrg Exp $ */
@ -64,7 +64,7 @@ typedef struct sslinfo_t {
* the error provided by the caller at the point of error it pops and
* prints all errors from the SSL error queue.
*/
BOZO_DEAD static void
BOZO_PRINTFLIKE(3, 4) BOZO_DEAD static void
bozo_ssl_err(bozohttpd_t *httpd, int code, const char *fmt, ...)
{
va_list ap;
@ -96,7 +96,7 @@ bozo_ssl_err(bozohttpd_t *httpd, int code, const char *fmt, ...)
exit(code);
}
static int
static BOZO_PRINTFLIKE(2, 0) int
bozo_ssl_printf(bozohttpd_t *httpd, const char * fmt, va_list ap)
{
sslinfo_t *sslinfo;