diff --git a/lib/libc/db/test/dbtest.c b/lib/libc/db/test/dbtest.c index ebf6be883be4..be433c0a3040 100644 --- a/lib/libc/db/test/dbtest.c +++ b/lib/libc/db/test/dbtest.c @@ -64,7 +64,7 @@ enum S { COMMAND, COMPARE, GET, PUT, REMOVE, SEQ, SEQFLAG, KEY, DATA }; void compare __P((DBT *, DBT *)); DBTYPE dbtype __P((char *)); void dump __P((DB *, int)); -void err __P((const char *, ...)); +void err __P((const char *, ...)) __printflike(1, 2); void get __P((DB *, DBT *)); void getdata __P((DB *, DBT *, DBT *)); void put __P((DB *, DBT *, DBT *)); diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index 4a566557d3c0..a11364076012 100644 --- a/lib/libc/net/gethostbydns.c +++ b/lib/libc/net/gethostbydns.c @@ -98,6 +98,10 @@ static u_char host_addr[16]; /* IPv4 or IPv6 */ static void addrsort __P((char **, int)); #endif +#ifdef DEBUG +static void dprintf(char *, int) __printflike(1, 0); +#endif + #if PACKETSZ > 1024 #define MAXPACKET PACKETSZ #else diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 49d4971270d2..11f2b21d6b21 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -71,7 +71,7 @@ static const char rcsid[] = #define FLOATING_POINT static int __sprint __P((FILE *, struct __suio *)); -static int __sbprintf __P((FILE *, const char *, va_list)); +static int __sbprintf __P((FILE *, const char *, va_list)) __printflike(2, 0); static char * __ultoa __P((u_long, char *, int, int, char *)); static char * __uqtoa __P((u_quad_t, char *, int, int, char *)); static void __find_arguments __P((const char *, va_list, void ***)); diff --git a/lib/libc_r/test/mutex_d.c b/lib/libc_r/test/mutex_d.c index ea31299e1aef..21bf84850060 100644 --- a/lib/libc_r/test/mutex_d.c +++ b/lib/libc_r/test/mutex_d.c @@ -59,6 +59,9 @@ #define MAX_THREAD_CMDS 10 +static void log_error(const char *, ...) __printflike(1, 2); +static void log_trace (const char *, ...) __printflike(1, 2); +static void log (const char *, ...) __printflike(1, 2); /*------------------------------------------------------------ * Types diff --git a/lib/libcam/camlib.h b/lib/libcam/camlib.h index 420129431b0c..8d1823a7c0b9 100644 --- a/lib/libcam/camlib.h +++ b/lib/libcam/camlib.h @@ -150,11 +150,11 @@ int cam_get_device(const char *path, char *dev_name, /* * Buffer encoding/decoding routines, from the old SCSI library. */ -int csio_decode(struct ccb_scsiio *csio, char *fmt, ...); +int csio_decode(struct ccb_scsiio *csio, char *fmt, ...) __printflike(2, 3); int csio_decode_visit(struct ccb_scsiio *csio, char *fmt, void (*arg_put)(void *, int, void *, int, char *), void *puthook); -int buff_decode(u_int8_t *buff, size_t len, char *fmt, ...); +int buff_decode(u_int8_t *buff, size_t len, char *fmt, ...) __printflike(3, 4); int buff_decode_visit(u_int8_t *buff, size_t len, char *fmt, void (*arg_put)(void *, int, void *, int, char *), void *puthook); @@ -166,7 +166,7 @@ int csio_build_visit(struct ccb_scsiio *csio, u_int8_t *data_ptr, int timeout, char *cmd_spec, int (*arg_get)(void *hook, char *field_name), void *gethook); -int csio_encode(struct ccb_scsiio *csio, char *fmt, ...); +int csio_encode(struct ccb_scsiio *csio, char *fmt, ...) __printflike(2, 3); int buff_encode_visit(u_int8_t *buff, size_t len, char *fmt, int (*arg_get)(void *hook, char *field_name), void *gethook); diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c index 366e3738e767..567bea4806f5 100644 --- a/lib/libdisk/create_chunk.c +++ b/lib/libdisk/create_chunk.c @@ -27,6 +27,8 @@ #include #include "libdisk.h" +static void msgDebug(char *, ...) __printflike(1, 2); + /* Clone these two from sysinstall because we need our own copies * due to link order problems with `crunch'. Feh! */ diff --git a/lib/libkse/test/mutex_d.c b/lib/libkse/test/mutex_d.c index ea31299e1aef..21bf84850060 100644 --- a/lib/libkse/test/mutex_d.c +++ b/lib/libkse/test/mutex_d.c @@ -59,6 +59,9 @@ #define MAX_THREAD_CMDS 10 +static void log_error(const char *, ...) __printflike(1, 2); +static void log_trace (const char *, ...) __printflike(1, 2); +static void log (const char *, ...) __printflike(1, 2); /*------------------------------------------------------------ * Types diff --git a/lib/libkvm/kvm_private.h b/lib/libkvm/kvm_private.h index 402b9ee6d849..85d790f882d5 100644 --- a/lib/libkvm/kvm_private.h +++ b/lib/libkvm/kvm_private.h @@ -70,7 +70,7 @@ struct __kvm { /* * Functions used internally by kvm, but across kvm modules. */ -void _kvm_err __P((kvm_t *kd, const char *program, const char *fmt, ...)); +void _kvm_err __P((kvm_t *kd, const char *program, const char *fmt, ...)) __printflike(3, 4); void _kvm_freeprocs __P((kvm_t *kd)); void _kvm_freevtop __P((kvm_t *)); int _kvm_initvtop __P((kvm_t *)); @@ -78,5 +78,5 @@ int _kvm_kvatop __P((kvm_t *, u_long, u_long *)); void *_kvm_malloc __P((kvm_t *kd, size_t)); void *_kvm_realloc __P((kvm_t *kd, void *, size_t)); void _kvm_syserr - __P((kvm_t *kd, const char *program, const char *fmt, ...)); + __P((kvm_t *kd, const char *program, const char *fmt, ...)) __printflike(3, 4); int _kvm_uvatop __P((kvm_t *, const struct proc *, u_long, u_long *)); diff --git a/lib/libncp/ncpl_subr.c b/lib/libncp/ncpl_subr.c index 0a36126079a6..768c183ff56a 100644 --- a/lib/libncp/ncpl_subr.c +++ b/lib/libncp/ncpl_subr.c @@ -435,7 +435,7 @@ ncp_args_parseopt(struct ncp_args *na, int opt, char *optarg, ncp_setopt_t *set_ * the rest - requester error; */ void -ncp_error(char *fmt, int error,...) { +ncp_error(const char *fmt, int error, ...) { va_list ap; fprintf(stderr, "%s: ", __progname); diff --git a/lib/libnetgraph/netgraph.h b/lib/libnetgraph/netgraph.h index c5a87cb4bc93..d0f402ca6aa0 100644 --- a/lib/libnetgraph/netgraph.h +++ b/lib/libnetgraph/netgraph.h @@ -48,9 +48,9 @@ __BEGIN_DECLS int NgMkSockNode(const char *, int *, int *); -int NgNameNode(int, const char *, const char *, ...); +int NgNameNode(int, const char *, const char *, ...) __printflike(3, 4); int NgSendMsg(int, const char *, int, int, const void *, size_t); -int NgSendAsciiMsg(int, const char *, const char *, ...); +int NgSendAsciiMsg(int, const char *, const char *, ...) __printflike(3, 4); int NgSendReplyMsg(int, const char *, const struct ng_mesg *, const void *, size_t); int NgRecvMsg(int, struct ng_mesg *, size_t, char *); diff --git a/lib/libpthread/test/mutex_d.c b/lib/libpthread/test/mutex_d.c index ea31299e1aef..21bf84850060 100644 --- a/lib/libpthread/test/mutex_d.c +++ b/lib/libpthread/test/mutex_d.c @@ -59,6 +59,9 @@ #define MAX_THREAD_CMDS 10 +static void log_error(const char *, ...) __printflike(1, 2); +static void log_trace (const char *, ...) __printflike(1, 2); +static void log (const char *, ...) __printflike(1, 2); /*------------------------------------------------------------ * Types diff --git a/sys/netncp/ncp_lib.h b/sys/netncp/ncp_lib.h index d99d03f97816..e1fee6c46165 100644 --- a/sys/netncp/ncp_lib.h +++ b/sys/netncp/ncp_lib.h @@ -168,7 +168,7 @@ NWCCODE NWDisableTTS(NWCONN_HANDLE); NWCCODE NWEnableTTS(NWCONN_HANDLE); NWCCODE NWDisableFileServerLogin(NWCONN_HANDLE); NWCCODE NWEnableFileServerLogin(NWCONN_HANDLE); -void ncp_error(char *, int,...); +void ncp_error(const char *, int, ...) __printf0like(1, 3); char *ncp_printb(char *, int, const struct ncp_bitname *); void nw_keyhash(const u_char *, const u_char *, int, u_char *); void nw_encrypt(const u_char *, const u_char *, u_char *);