summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorjoerg <joerg@NetBSD.org>2012-03-14 23:47:19 +0000
committerjoerg <joerg@NetBSD.org>2012-03-14 23:47:19 +0000
commitb1e56157f4d9fdc36d9ec27be030e9dd547e1a3c (patch)
tree822543deb2cc2edea4ac4555e7529cc420419323 /libexec
parent64c407858b9b8c9236c83240efaa1c723ef426a8 (diff)
Add BOZO_PRINTFLIKE for functions that pass an argument and va_arg to
a vprintf-like function.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/httpd/bozohttpd.h17
-rw-r--r--libexec/httpd/ssl-bozo.c6
2 files changed, 11 insertions, 12 deletions
diff --git a/libexec/httpd/bozohttpd.h b/libexec/httpd/bozohttpd.h
index 44baf4b79c9..bad55a512b1 100644
--- a/libexec/httpd/bozohttpd.h
+++ b/libexec/httpd/bozohttpd.h
@@ -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>")
+#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 *, ...)
- __attribute__((__format__(__printf__, 3, 4)));
+void debug__(bozohttpd_t *, int, const char *, ...) BOZO_PRINTFLIKE(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
-
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 *);
diff --git a/libexec/httpd/ssl-bozo.c b/libexec/httpd/ssl-bozo.c
index 96e12895de4..0d52f4d9d29 100644
--- a/libexec/httpd/ssl-bozo.c
+++ b/libexec/httpd/ssl-bozo.c
@@ -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;