tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Adding missing __printflike attributions
Hi all,
the attached patch addes the missing __printflike attribution for cases
where a function calls a va_list variant like vprintf and passes an
argument as format string down. The benefit of the attribution is
correct format string checking. I'm committed all real fixes outside
src/external, src/crypto/external and src/tests already.
ATF is a bit special in this case as the documented interface of
atf_tc_set_md_var disagrees with the implementation. From the changes,
usage is simpler if the documentation is changed to match the implementation.
If you are involved with one of the upstream code bases touched by the
patch, please take this up and see what the prefered form of change is.
Joerg
Index: bin/expr/expr.y
===================================================================
RCS file: /home/joerg/repo/netbsd/src/bin/expr/expr.y,v
retrieving revision 1.37
diff -u -p -r1.37 expr.y
--- bin/expr/expr.y 25 Aug 2011 01:11:47 -0000 1.37
+++ bin/expr/expr.y 1 Mar 2012 22:16:06 -0000
@@ -430,7 +430,7 @@ yylex(void)
/*
* Print error message and exit with error 2 (syntax error).
*/
-static void
+static __printflike(1, 2) void
yyerror(const char *fmt, ...)
{
va_list arg;
Index: bin/sh/error.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/bin/sh/error.c,v
retrieving revision 1.37
diff -u -p -r1.37 error.c
--- bin/sh/error.c 16 Oct 2008 14:36:40 -0000 1.37
+++ bin/sh/error.c 1 Mar 2012 22:16:06 -0000
@@ -120,7 +120,7 @@ onint(void)
/* NOTREACHED */
}
-static void
+static __printflike(2, 0) void
exvwarning(int sv_errno, const char *msg, va_list ap)
{
/* Partially emulate line buffered output so that:
@@ -151,7 +151,7 @@ exvwarning(int sv_errno, const char *msg
* is not NULL then error prints an error message using printf style
* formatting. It then raises the error exception.
*/
-static void
+static __printflike(2, 0) void
exverror(int cond, const char *msg, va_list ap)
{
CLEAR_PENDING_INT;
Index: bin/sh/error.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/bin/sh/error.h,v
retrieving revision 1.18
diff -u -p -r1.18 error.h
--- bin/sh/error.h 23 Aug 2011 09:59:20 -0000 1.18
+++ bin/sh/error.h 1 Mar 2012 22:16:06 -0000
@@ -89,33 +89,23 @@ extern volatile int intpending;
#define int_pending() intpending
#if ! defined(SHELL_BUILTIN)
-void exraise(int) __attribute__((__noreturn__));
+void exraise(int) __dead;
void onint(void);
-void error(const char *, ...) __attribute__((__noreturn__))
- __attribute__((__format__(__printf__, 1, 2)));
-void exerror(int, const char *, ...) __attribute__((__noreturn__))
- __attribute__((__format__(__printf__, 2, 3)));
+void error(const char *, ...) __dead __printflike(1, 2);
+void exerror(int, const char *, ...) __dead __printflike(2, 3);
const char *errmsg(int, int);
#endif /* ! SHELL_BUILTIN */
-void sh_err(int, const char *, ...) __attribute__((__noreturn__))
- __attribute__((__format__(__printf__, 2, 3)));
-void sh_verr(int, const char *, va_list) __attribute__((__noreturn__))
- __attribute__((__format__(__printf__, 2, 0)));
-void sh_errx(int, const char *, ...) __attribute__((__noreturn__))
- __attribute__((__format__(__printf__, 2, 3)));
-void sh_verrx(int, const char *, va_list) __attribute__((__noreturn__))
- __attribute__((__format__(__printf__, 2, 0)));
-void sh_warn(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
-void sh_vwarn(const char *, va_list)
- __attribute__((__format__(__printf__, 1, 0)));
-void sh_warnx(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
-void sh_vwarnx(const char *, va_list)
- __attribute__((__format__(__printf__, 1, 0)));
+void sh_err(int, const char *, ...) __dead __printflike(2, 3);
+void sh_verr(int, const char *, va_list) __dead __printflike(2, 0);
+void sh_errx(int, const char *, ...) __dead __printflike(2, 3);
+void sh_verrx(int, const char *, va_list) __dead __printflike(2, 0);
+void sh_warn(const char *, ...) __printflike(1, 2);
+void sh_vwarn(const char *, va_list) __printflike(1, 0);
+void sh_warnx(const char *, ...) __printflike(1, 2);
+void sh_vwarnx(const char *, va_list) __printflike(1, 0);
-void sh_exit(int) __attribute__((__noreturn__));
+void sh_exit(int) __dead;
/*
Index: bin/sh/exec.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/bin/sh/exec.h,v
retrieving revision 1.22
diff -u -p -r1.22 exec.h
--- bin/sh/exec.h 18 Jun 2011 21:18:46 -0000 1.22
+++ bin/sh/exec.h 1 Mar 2012 22:16:06 -0000
@@ -61,8 +61,7 @@ struct cmdentry {
extern const char *pathopt; /* set by padvance */
-void shellexec(char **, char **, const char *, int, int)
- __attribute__((__noreturn__));
+void shellexec(char **, char **, const char *, int, int) __dead;
char *padvance(const char **, const char *);
void find_command(char *, struct cmdentry *, int, const char *);
int (*find_builtin(char *))(int, char **);
Index: bin/sh/output.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/bin/sh/output.h,v
retrieving revision 1.23
diff -u -p -r1.23 output.h
--- bin/sh/output.h 23 Aug 2011 09:59:20 -0000 1.23
+++ bin/sh/output.h 1 Mar 2012 22:16:06 -0000
@@ -66,18 +66,13 @@ void emptyoutbuf(struct output *);
void flushall(void);
void flushout(struct output *);
void freestdout(void);
-void outfmt(struct output *, const char *, ...)
- __attribute__((__format__(__printf__, 2, 3)));
-void out1fmt(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
+void outfmt(struct output *, const char *, ...) __printflike(2, 3);
+void out1fmt(const char *, ...) __printflike(1, 2);
#ifdef DEBUG
-void debugprintf(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
+void debugprintf(const char *, ...) __printflike(1, 2);
#endif
-void fmtstr(char *, size_t, const char *, ...)
- __attribute__((__format__(__printf__, 3, 4)));
-void doformat(struct output *, const char *, va_list)
- __attribute__((__format__(__printf__, 2, 0)));
+void fmtstr(char *, size_t, const char *, ...) __printflike(3, 4);
+void doformat(struct output *, const char *, va_list) __printflike(2, 0);
int xwrite(int, char *, int);
int xioctl(int, unsigned long, char *);
Index: bin/sh/trap.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/bin/sh/trap.h,v
retrieving revision 1.19
diff -u -p -r1.19 trap.h
--- bin/sh/trap.h 18 Jun 2011 21:18:46 -0000 1.19
+++ bin/sh/trap.h 1 Mar 2012 22:16:06 -0000
@@ -42,4 +42,4 @@ void ignoresig(int, int);
void onsig(int);
void dotrap(void);
void setinteractive(int);
-void exitshell(int) __attribute__((__noreturn__));
+void exitshell(int) __dead;
Index: bin/test/test.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/bin/test/test.c,v
retrieving revision 1.38
diff -u -p -r1.38 test.c
--- bin/test/test.c 29 Aug 2011 14:51:19 -0000 1.38
+++ bin/test/test.c 1 Mar 2012 22:16:06 -0000
@@ -172,10 +172,10 @@ static int olderf(const char *, const ch
static int equalf(const char *, const char *);
#if defined(SHELL)
-extern void error(const char *, ...) __dead;
+extern void error(const char *, ...) __dead __printflike(1, 2);
extern void *ckmalloc(size_t);
#else
-static void error(const char *, ...) __dead;
+static void error(const char *, ...) __dead __printflike(1, 2);
static void
error(const char *msg, ...)
Index: crypto/external/bsd/netpgp/dist/src/lib/compress.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/crypto/external/bsd/netpgp/dist/src/lib/compress.c,v
retrieving revision 1.21
diff -u -p -r1.21 compress.c
--- crypto/external/bsd/netpgp/dist/src/lib/compress.c 15 Nov 2010 08:03:39
-0000 1.21
+++ crypto/external/bsd/netpgp/dist/src/lib/compress.c 1 Mar 2012 22:16:06
-0000
@@ -176,8 +176,9 @@ zlib_compressed_data_reader(pgp_stream_t
}
} else if (ret != Z_OK) {
(void) fprintf(stderr, "ret=%d\n", ret);
- PGP_ERROR(cbinfo->errors,
- PGP_E_P_DECOMPRESSION_ERROR, z->zstream.msg);
+ PGP_ERROR_1(cbinfo->errors,
+ PGP_E_P_DECOMPRESSION_ERROR, "%s",
+ z->zstream.msg);
}
z->inflate_ret = ret;
}
Index: crypto/external/bsd/netpgp/dist/src/lib/errors.h
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/crypto/external/bsd/netpgp/dist/src/lib/errors.h,v
retrieving revision 1.6
diff -u -p -r1.6 errors.h
--- crypto/external/bsd/netpgp/dist/src/lib/errors.h 7 Nov 2010 08:39:59
-0000 1.6
+++ crypto/external/bsd/netpgp/dist/src/lib/errors.h 1 Mar 2012 22:16:06
-0000
@@ -134,8 +134,7 @@ const char *pgp_errcode(const pgp_er
void
pgp_push_error(pgp_error_t **, pgp_errcode_t,
- int,
- const char *, int, const char *,...);
+ int, const char *, int, const char *,...) __printflike(6, 7);
void pgp_print_error(pgp_error_t *);
void pgp_print_errors(pgp_error_t *);
void pgp_free_errors(pgp_error_t *);
Index: crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h,v
retrieving revision 1.10
diff -u -p -r1.10 netpgpsdk.h
--- crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h 7 Nov 2010 08:39:59
-0000 1.10
+++ crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h 1 Mar 2012 22:16:06
-0000
@@ -63,9 +63,9 @@ unsigned pgp_check_sig(const uint8_t *
const char *pgp_get_info(const char *type);
-int pgp_asprintf(char **, const char *, ...);
+int pgp_asprintf(char **, const char *, ...) __printflike(2, 3);
-void netpgp_log(const char *, ...);
+void netpgp_log(const char *, ...) __printflike(1, 2);
int netpgp_strcasecmp(const char *, const char *);
char *netpgp_strdup(const char *);
Index: crypto/external/bsd/openssh/dist/log.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/crypto/external/bsd/openssh/dist/log.h,v
retrieving revision 1.4
diff -u -p -r1.4 log.h
--- crypto/external/bsd/openssh/dist/log.h 7 Sep 2011 17:49:19 -0000
1.4
+++ crypto/external/bsd/openssh/dist/log.h 1 Mar 2012 22:16:06 -0000
@@ -68,6 +68,6 @@ void debug3(const char *, ...) __att
void set_log_handler(log_handler_fn *, void *);
void do_log2(LogLevel, const char *, ...)
__attribute__((format(printf, 2, 3)));
-void do_log(LogLevel, const char *, va_list);
+void do_log(LogLevel, const char *, va_list) __printflike(2, 0);
void cleanup_exit(int) __attribute__((noreturn));
#endif
Index: crypto/external/bsd/openssh/dist/scp.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/crypto/external/bsd/openssh/dist/scp.c,v
retrieving revision 1.6
diff -u -p -r1.6 scp.c
--- crypto/external/bsd/openssh/dist/scp.c 16 Sep 2011 15:36:18 -0000
1.6
+++ crypto/external/bsd/openssh/dist/scp.c 1 Mar 2012 22:16:06 -0000
@@ -340,7 +340,7 @@ typedef struct {
BUF *allocbuf(BUF *, int, int);
__dead static void lostconn(int);
int okname(char *);
-void run_err(const char *,...);
+void run_err(const char *,...) __printflike(1, 2);
void verifydir(char *);
struct passwd *pwd;
Index: external/bsd/atf/dist/atf-c/error.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/error.h,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 error.h
--- external/bsd/atf/dist/atf-c/error.h 16 Jan 2012 22:36:30 -0000 1.1.1.4
+++ external/bsd/atf/dist/atf-c/error.h 1 Mar 2012 22:16:13 -0000
@@ -62,7 +62,7 @@ void atf_error_format(const atf_error_t,
* Common error types.
* --------------------------------------------------------------------- */
-atf_error_t atf_libc_error(int, const char *, ...);
+atf_error_t atf_libc_error(int, const char *, ...) __printflike(2, 3);
int atf_libc_error_code(const atf_error_t);
const char *atf_libc_error_msg(const atf_error_t);
Index: external/bsd/atf/dist/atf-c/tc.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/tc.c,v
retrieving revision 1.12
diff -u -p -r1.12 tc.c
--- external/bsd/atf/dist/atf-c/tc.c 16 Jan 2012 22:41:30 -0000 1.12
+++ external/bsd/atf/dist/atf-c/tc.c 1 Mar 2012 22:16:13 -0000
@@ -79,13 +79,13 @@ struct context {
static void context_init(struct context *, const atf_tc_t *, const char *);
static void check_fatal_error(atf_error_t);
static void report_fatal_error(const char *, ...)
- ATF_DEFS_ATTRIBUTE_NORETURN;
+ ATF_DEFS_ATTRIBUTE_NORETURN __printflike(1, 2);
static atf_error_t write_resfile(const int, const char *, const int,
const atf_dynstr_t *);
static void create_resfile(const char *, const char *, const int,
atf_dynstr_t *);
static void error_in_expect(struct context *, const char *, ...)
- ATF_DEFS_ATTRIBUTE_NORETURN;
+ ATF_DEFS_ATTRIBUTE_NORETURN __printflike(2, 3);
static void validate_expect(struct context *);
static void expected_failure(struct context *, atf_dynstr_t *)
ATF_DEFS_ATTRIBUTE_NORETURN;
@@ -97,9 +97,9 @@ static void pass(struct context *)
static void skip(struct context *, atf_dynstr_t *)
ATF_DEFS_ATTRIBUTE_NORETURN;
static void format_reason_ap(atf_dynstr_t *, const char *, const size_t,
- const char *, va_list);
+ const char *, va_list) __printflike(4, 0);
static void format_reason_fmt(atf_dynstr_t *, const char *, const size_t,
- const char *, ...);
+ const char *, ...) __printflike(4, 5);
static void errno_test(struct context *, const char *, const size_t,
const int, const char *, const bool,
void (*)(struct context *, atf_dynstr_t *));
@@ -571,7 +571,7 @@ atf_tc_init(atf_tc_t *tc, const char *id
if (atf_is_error(err))
goto err_vars;
- err = atf_tc_set_md_var(tc, "ident", ident);
+ err = atf_tc_set_md_var(tc, "ident", "%s", ident);
if (atf_is_error(err))
goto err_map;
@@ -787,28 +787,33 @@ atf_tc_set_md_var(atf_tc_t *tc, const ch
* --------------------------------------------------------------------- */
static void _atf_tc_fail(struct context *, const char *, va_list)
- ATF_DEFS_ATTRIBUTE_NORETURN;
-static void _atf_tc_fail_nonfatal(struct context *, const char *, va_list);
+ ATF_DEFS_ATTRIBUTE_NORETURN __printflike(2, 0);
+static void _atf_tc_fail_nonfatal(struct context *, const char *, va_list)
+ __printflike(2, 0);
static void _atf_tc_fail_check(struct context *, const char *, const size_t,
- const char *, va_list);
+ const char *, va_list) __printflike(4, 0);
static void _atf_tc_fail_requirement(struct context *, const char *,
- const size_t, const char *, va_list) ATF_DEFS_ATTRIBUTE_NORETURN;
+ const size_t, const char *, va_list) ATF_DEFS_ATTRIBUTE_NORETURN
+ __printflike(4, 0);
static void _atf_tc_pass(struct context *) ATF_DEFS_ATTRIBUTE_NORETURN;
static void _atf_tc_require_prog(struct context *, const char *);
static void _atf_tc_skip(struct context *, const char *, va_list)
- ATF_DEFS_ATTRIBUTE_NORETURN;
+ ATF_DEFS_ATTRIBUTE_NORETURN __printflike(2, 0);
static void _atf_tc_check_errno(struct context *, const char *, const size_t,
const int, const char *, const bool);
static void _atf_tc_require_errno(struct context *, const char *, const size_t,
const int, const char *, const bool);
static void _atf_tc_expect_pass(struct context *);
-static void _atf_tc_expect_fail(struct context *, const char *, va_list);
+static void _atf_tc_expect_fail(struct context *, const char *, va_list)
+ __printflike(2, 0);
static void _atf_tc_expect_exit(struct context *, const int, const char *,
- va_list);
+ va_list) __printflike(3, 0);
static void _atf_tc_expect_signal(struct context *, const int, const char *,
- va_list);
+ va_list) __printflike(3, 0);
static void _atf_tc_expect_death(struct context *, const char *,
- va_list);
+ va_list) __printflike(2, 0);
+static void _atf_tc_expect_timeout(struct context *, const char *, va_list)
+ __printflike(2, 0);
static void
_atf_tc_fail(struct context *ctx, const char *fmt, va_list ap)
@@ -1016,13 +1021,13 @@ atf_tc_run(const atf_tc_t *tc, const cha
if (Current.fail_count > 0) {
atf_dynstr_t reason;
- format_reason_fmt(&reason, NULL, 0, "%d checks failed; see output for "
+ format_reason_fmt(&reason, NULL, 0, "%zu checks failed; see output for
"
"more details", Current.fail_count);
fail_requirement(&Current, &reason);
} else if (Current.expect_fail_count > 0) {
atf_dynstr_t reason;
- format_reason_fmt(&reason, NULL, 0, "%d checks failed as expected; "
+ format_reason_fmt(&reason, NULL, 0, "%zu checks failed as expected; "
"see output for more details", Current.expect_fail_count);
expected_failure(&Current, &reason);
} else {
Index: external/bsd/atf/dist/atf-c/tc.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/tc.h,v
retrieving revision 1.4
diff -u -p -r1.4 tc.h
--- external/bsd/atf/dist/atf-c/tc.h 16 Jan 2012 22:41:30 -0000 1.4
+++ external/bsd/atf/dist/atf-c/tc.h 1 Mar 2012 22:16:13 -0000
@@ -93,7 +93,8 @@ bool atf_tc_has_config_var(const atf_tc_
bool atf_tc_has_md_var(const atf_tc_t *, const char *);
/* Modifiers. */
-atf_error_t atf_tc_set_md_var(atf_tc_t *, const char *, const char *, ...);
+atf_error_t atf_tc_set_md_var(atf_tc_t *, const char *, const char *, ...)
+ __printflike(3, 4);
/* ---------------------------------------------------------------------
* Free functions.
Index: external/bsd/atf/dist/atf-c/detail/dynstr.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/detail/dynstr.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 dynstr.c
--- external/bsd/atf/dist/atf-c/detail/dynstr.c 16 Jan 2012 22:36:36 -0000
1.1.1.2
+++ external/bsd/atf/dist/atf-c/detail/dynstr.c 1 Mar 2012 22:16:13 -0000
@@ -67,7 +67,7 @@ resize(atf_dynstr_t *ad, size_t newsize)
return err;
}
-static
+static __printflike(2, 0)
atf_error_t
prepend_or_append(atf_dynstr_t *ad, const char *fmt, va_list ap,
bool prepend)
Index: external/bsd/atf/dist/atf-c/detail/dynstr.h
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/detail/dynstr.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 dynstr.h
--- external/bsd/atf/dist/atf-c/detail/dynstr.h 16 Jan 2012 22:36:36 -0000
1.1.1.2
+++ external/bsd/atf/dist/atf-c/detail/dynstr.h 1 Mar 2012 22:16:13 -0000
@@ -52,8 +52,10 @@ extern const size_t atf_dynstr_npos;
/* Constructors and destructors */
atf_error_t atf_dynstr_init(atf_dynstr_t *);
-atf_error_t atf_dynstr_init_ap(atf_dynstr_t *, const char *, va_list);
-atf_error_t atf_dynstr_init_fmt(atf_dynstr_t *, const char *, ...);
+atf_error_t atf_dynstr_init_ap(atf_dynstr_t *, const char *, va_list)
+ __printflike(2, 0);
+atf_error_t atf_dynstr_init_fmt(atf_dynstr_t *, const char *, ...)
+ __printflike(2, 3);
atf_error_t atf_dynstr_init_raw(atf_dynstr_t *, const void *, size_t);
atf_error_t atf_dynstr_init_rep(atf_dynstr_t *, size_t, char);
atf_error_t atf_dynstr_init_substr(atf_dynstr_t *, const atf_dynstr_t *,
@@ -68,11 +70,15 @@ size_t atf_dynstr_length(const atf_dynst
size_t atf_dynstr_rfind_ch(const atf_dynstr_t *, char);
/* Modifiers */
-atf_error_t atf_dynstr_append_ap(atf_dynstr_t *, const char *, va_list);
-atf_error_t atf_dynstr_append_fmt(atf_dynstr_t *, const char *, ...);
+atf_error_t atf_dynstr_append_ap(atf_dynstr_t *, const char *, va_list)
+ __printflike(2, 0);
+atf_error_t atf_dynstr_append_fmt(atf_dynstr_t *, const char *, ...)
+ __printflike(2, 3);
void atf_dynstr_clear(atf_dynstr_t *);
-atf_error_t atf_dynstr_prepend_ap(atf_dynstr_t *, const char *, va_list);
-atf_error_t atf_dynstr_prepend_fmt(atf_dynstr_t *, const char *, ...);
+atf_error_t atf_dynstr_prepend_ap(atf_dynstr_t *, const char *, va_list)
+ __printflike(2, 0);
+atf_error_t atf_dynstr_prepend_fmt(atf_dynstr_t *, const char *, ...)
+ __printflike(2, 3);
/* Operators */
bool atf_equal_dynstr_cstring(const atf_dynstr_t *, const char *);
Index: external/bsd/atf/dist/atf-c/detail/fs.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/detail/fs.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 fs.c
--- external/bsd/atf/dist/atf-c/detail/fs.c 16 Jan 2012 22:36:36 -0000
1.1.1.2
+++ external/bsd/atf/dist/atf-c/detail/fs.c 1 Mar 2012 22:16:13 -0000
@@ -63,7 +63,8 @@ static atf_error_t copy_contents(const a
static mode_t current_umask(void);
static atf_error_t do_mkdtemp(char *);
static atf_error_t normalize(atf_dynstr_t *, char *);
-static atf_error_t normalize_ap(atf_dynstr_t *, const char *, va_list);
+static atf_error_t normalize_ap(atf_dynstr_t *, const char *, va_list)
+ __printflike(2, 0);
static void replace_contents(atf_fs_path_t *, const char *);
static const char *stat_type_to_string(const int);
Index: external/bsd/atf/dist/atf-c/detail/fs.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/detail/fs.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 fs.h
--- external/bsd/atf/dist/atf-c/detail/fs.h 16 Jan 2012 22:36:36 -0000
1.1.1.2
+++ external/bsd/atf/dist/atf-c/detail/fs.h 1 Mar 2012 22:16:13 -0000
@@ -50,8 +50,10 @@ struct atf_fs_path {
typedef struct atf_fs_path atf_fs_path_t;
/* Constructors/destructors. */
-atf_error_t atf_fs_path_init_ap(atf_fs_path_t *, const char *, va_list);
-atf_error_t atf_fs_path_init_fmt(atf_fs_path_t *, const char *, ...);
+atf_error_t atf_fs_path_init_ap(atf_fs_path_t *, const char *, va_list)
+ __printflike(2, 0);
+atf_error_t atf_fs_path_init_fmt(atf_fs_path_t *, const char *, ...)
+ __printflike(2, 3);
atf_error_t atf_fs_path_copy(atf_fs_path_t *, const atf_fs_path_t *);
void atf_fs_path_fini(atf_fs_path_t *);
@@ -63,8 +65,10 @@ bool atf_fs_path_is_absolute(const atf_f
bool atf_fs_path_is_root(const atf_fs_path_t *);
/* Modifiers. */
-atf_error_t atf_fs_path_append_ap(atf_fs_path_t *, const char *, va_list);
-atf_error_t atf_fs_path_append_fmt(atf_fs_path_t *, const char *, ...);
+atf_error_t atf_fs_path_append_ap(atf_fs_path_t *, const char *, va_list)
+ __printflike(2, 0);
+atf_error_t atf_fs_path_append_fmt(atf_fs_path_t *, const char *, ...)
+ __printflike(2, 3);
atf_error_t atf_fs_path_append_path(atf_fs_path_t *, const atf_fs_path_t *);
atf_error_t atf_fs_path_to_absolute(const atf_fs_path_t *, atf_fs_path_t *);
Index: external/bsd/atf/dist/atf-c/detail/sanity.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/detail/sanity.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 sanity.c
--- external/bsd/atf/dist/atf-c/detail/sanity.c 20 Oct 2010 09:14:19 -0000
1.1.1.1
+++ external/bsd/atf/dist/atf-c/detail/sanity.c 1 Mar 2012 22:16:13 -0000
@@ -38,8 +38,7 @@
#include "sanity.h"
-static
-void
+static __dead __printflike(1, 2) void
fail(const char *fmt, ...)
{
va_list ap;
Index: external/bsd/atf/dist/atf-c/detail/test_helpers.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/detail/test_helpers.c,v
retrieving revision 1.3
diff -u -p -r1.3 test_helpers.c
--- external/bsd/atf/dist/atf-c/detail/test_helpers.c 16 Jan 2012 22:41:30
-0000 1.3
+++ external/bsd/atf/dist/atf-c/detail/test_helpers.c 1 Mar 2012 22:16:13
-0000
@@ -194,8 +194,8 @@ run_h_tc(atf_tc_t *tc, const char *outna
atf_process_child_t child;
atf_process_status_t status;
- RE(atf_fs_path_init_fmt(&outpath, outname));
- RE(atf_fs_path_init_fmt(&errpath, errname));
+ RE(atf_fs_path_init_fmt(&outpath, "%s", outname));
+ RE(atf_fs_path_init_fmt(&errpath, "%s", errname));
struct run_h_tc_data data = { tc, resname };
Index: external/bsd/atf/dist/atf-c/detail/text.h
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/detail/text.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 text.h
--- external/bsd/atf/dist/atf-c/detail/text.h 16 Jan 2012 22:36:37 -0000
1.1.1.2
+++ external/bsd/atf/dist/atf-c/detail/text.h 1 Mar 2012 22:16:13 -0000
@@ -40,8 +40,9 @@
atf_error_t atf_text_for_each_word(const char *, const char *,
atf_error_t (*)(const char *, void *),
void *);
-atf_error_t atf_text_format(char **, const char *, ...);
-atf_error_t atf_text_format_ap(char **, const char *, va_list);
+atf_error_t atf_text_format(char **, const char *, ...) __printflike(2, 3);
+atf_error_t atf_text_format_ap(char **, const char *, va_list)
+ __printflike(2, 0);
atf_error_t atf_text_split(const char *, const char *, atf_list_t *);
atf_error_t atf_text_to_bool(const char *, bool *);
atf_error_t atf_text_to_long(const char *, long *);
Index: external/bsd/atf/dist/atf-c/detail/tp_main.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c/detail/tp_main.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 tp_main.c
--- external/bsd/atf/dist/atf-c/detail/tp_main.c 16 Jan 2012 22:36:37
-0000 1.1.1.4
+++ external/bsd/atf/dist/atf-c/detail/tp_main.c 1 Mar 2012 22:16:13
-0000
@@ -88,7 +88,7 @@ enum tc_part {
snprintf(buf, buflen, "%s", data->m_what); \
} \
\
- static \
+ static __printflike(1, 2) \
atf_error_t \
name ## _error(const char *fmt, ...) \
{ \
Index: external/bsd/atf/dist/atf-c++/tests.cpp
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/atf/dist/atf-c++/tests.cpp,v
retrieving revision 1.8
diff -u -p -r1.8 tests.cpp
--- external/bsd/atf/dist/atf-c++/tests.cpp 16 Jan 2012 22:41:30 -0000
1.8
+++ external/bsd/atf/dist/atf-c++/tests.cpp 1 Mar 2012 22:16:13 -0000
@@ -268,7 +268,8 @@ impl::tc::get_md_vars(void)
void
impl::tc::set_md_var(const std::string& var, const std::string& val)
{
- atf_error_t err = atf_tc_set_md_var(&pimpl->m_tc, var.c_str(),
val.c_str());
+ atf_error_t err = atf_tc_set_md_var(&pimpl->m_tc, var.c_str(), "%s",
+ val.c_str());
if (atf_is_error(err))
throw_atf_error(err);
}
Index: external/bsd/fetch/dist/libfetch/common.h
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/fetch/dist/libfetch/common.h,v
retrieving revision 1.1.1.7
diff -u -p -r1.1.1.7 common.h
--- external/bsd/fetch/dist/libfetch/common.h 24 Mar 2010 20:51:42 -0000
1.1.1.7
+++ external/bsd/fetch/dist/libfetch/common.h 1 Mar 2012 22:16:13 -0000
@@ -90,7 +90,7 @@ struct fetcherr {
void fetch_seterr(struct fetcherr *, int);
void fetch_syserr(void);
-void fetch_info(const char *, ...);
+void fetch_info(const char *, ...) __printflike(1, 2);
int fetch_default_port(const char *);
int fetch_default_proxy_port(const char *);
int fetch_bind(int, int, const char *);
Index: external/bsd/fetch/dist/libfetch/ftp.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/fetch/dist/libfetch/ftp.c,v
retrieving revision 1.5
diff -u -p -r1.5 ftp.c
--- external/bsd/fetch/dist/libfetch/ftp.c 17 Aug 2011 09:19:38 -0000
1.5
+++ external/bsd/fetch/dist/libfetch/ftp.c 1 Mar 2012 22:16:13 -0000
@@ -196,7 +196,7 @@ ftp_chkerr(conn_t *conn)
/*
* Send a command and check reply
*/
-static int
+static __printflike(2, 3) int
ftp_cmd(conn_t *conn, const char *fmt, ...)
{
va_list ap;
@@ -389,7 +389,7 @@ ftp_cwd(conn_t *conn, const char *path,
++beg, ++i;
for (++i; dst + i < end && dst[i] != '/'; ++i)
/* nothing */ ;
- e = ftp_cmd(conn, "CWD %.*s\r\n", dst + i - beg, beg);
+ e = ftp_cmd(conn, "CWD %.*s\r\n", (int)(dst + i - beg), beg);
if (e != FTP_FILE_ACTION_OK) {
free(dst);
ftp_seterr(e);
@@ -487,7 +487,7 @@ ftp_stat(conn_t *conn, const char *file,
return (-1);
}
- e = ftp_cmd(conn, "SIZE %.*s\r\n", filenamelen, filename);
+ e = ftp_cmd(conn, "SIZE %.*s\r\n", (int)filenamelen, filename);
if (e != FTP_FILE_STATUS) {
ftp_seterr(e);
return (-1);
@@ -504,7 +504,7 @@ ftp_stat(conn_t *conn, const char *file,
if (us->size == 0)
us->size = -1;
- e = ftp_cmd(conn, "MDTM %.*s\r\n", filenamelen, filename);
+ e = ftp_cmd(conn, "MDTM %.*s\r\n", (int)filenamelen, filename);
if (e != FTP_FILE_STATUS) {
ftp_seterr(e);
return (-1);
@@ -849,7 +849,7 @@ retry_mode:
e = ftp_cmd(conn, "%s%s%s\r\n", oper, *op_arg ? " " :
"", op_arg);
else
e = ftp_cmd(conn, "%s %.*s\r\n", oper,
- filenamelen, filename);
+ (int)filenamelen, filename);
if (e != FTP_CONNECTION_ALREADY_OPEN && e !=
FTP_OPEN_DATA_CONNECTION)
goto ouch;
@@ -946,7 +946,7 @@ retry_mode:
e = ftp_cmd(conn, "%s%s%s\r\n", oper, *op_arg ? " " :
"", op_arg);
else
e = ftp_cmd(conn, "%s %.*s\r\n", oper,
- filenamelen, filename);
+ (int)filenamelen, filename);
if (e != FTP_CONNECTION_ALREADY_OPEN && e !=
FTP_OPEN_DATA_CONNECTION)
goto ouch;
Index: external/bsd/fetch/dist/libfetch/http.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/fetch/dist/libfetch/http.c,v
retrieving revision 1.2
diff -u -p -r1.2 http.c
--- external/bsd/fetch/dist/libfetch/http.c 25 Jun 2011 20:27:01 -0000
1.2
+++ external/bsd/fetch/dist/libfetch/http.c 1 Mar 2012 22:16:13 -0000
@@ -404,7 +404,7 @@ static struct {
/*
* Send a formatted line; optionally echo to terminal
*/
-static int
+static __printflike(2, 3) int
http_cmd(conn_t *conn, const char *fmt, ...)
{
va_list ap;
Index: external/bsd/file/dist/src/file.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/file/dist/src/file.h,v
retrieving revision 1.6
diff -u -p -r1.6 file.h
--- external/bsd/file/dist/src/file.h 22 Feb 2012 17:53:51 -0000 1.6
+++ external/bsd/file/dist/src/file.h 1 Mar 2012 22:16:13 -0000
@@ -393,7 +393,8 @@ protected int file_buffer(struct magic_s
size_t);
protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
-protected int file_vprintf(struct magic_set *, const char *, va_list);
+protected int file_vprintf(struct magic_set *, const char *, va_list)
+ __attribute__((__format__(__printf__, 2, 0)));
protected size_t file_printedlen(const struct magic_set *);
protected int file_replace(struct magic_set *, const char *, const char *);
protected int file_printf(struct magic_set *, const char *, ...)
Index: external/bsd/file/dist/src/funcs.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/file/dist/src/funcs.c,v
retrieving revision 1.4
diff -u -p -r1.4 funcs.c
--- external/bsd/file/dist/src/funcs.c 22 Feb 2012 17:53:51 -0000 1.4
+++ external/bsd/file/dist/src/funcs.c 1 Mar 2012 22:16:13 -0000
@@ -99,6 +99,7 @@ file_printf(struct magic_set *ms, const
* error - print best error message possible
*/
/*VARARGS*/
+__attribute__((__format__(__printf__, 3, 0)))
private void
file_error_core(struct magic_set *ms, int error, const char *f, va_list va,
size_t lineno)
Index: external/bsd/iscsi/dist/include/iscsiutil.h
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/iscsi/dist/include/iscsiutil.h,v
retrieving revision 1.3
diff -u -p -r1.3 iscsiutil.h
--- external/bsd/iscsi/dist/include/iscsiutil.h 30 Jun 2009 02:44:52 -0000
1.3
+++ external/bsd/iscsi/dist/include/iscsiutil.h 1 Mar 2012 22:16:13 -0000
@@ -144,9 +144,12 @@ EXTERN uint32_t iscsi_debug_level;
* Debugging Functions
*/
void set_debug(const char *);
-void iscsi_trace(const int, const char *, ...);
-void iscsi_warn(const char *, const int, const char *, ...);
-void iscsi_err(const char *, const int, const char *, ...);
+void iscsi_trace(const int, const char *, ...)
+ __printflike(2, 3);
+void iscsi_warn(const char *, const int, const char *, ...)
+ __printflike(3, 4);
+void iscsi_err(const char *, const int, const char *, ...)
+ __printflike(3, 4);
void iscsi_print_buffer(const char *, const size_t);
@@ -417,7 +420,7 @@ typedef struct {
} iscsi_worker_t;
#define ISCSI_WORKER_EXIT(ME) do { \
- iscsi_trace(TRACE_ISCSI_DEBUG ,__FILE__, __LINE__, "exiting\n");\
+ iscsi_trace(TRACE_ISCSI_DEBUG, "%s:%d: %s", __FILE__, __LINE__,
"exiting\n");\
(ME)->state |= ISCSI_WORKER_STATE_EXITING; \
return 0; \
/* NOTREACHED */ \
Index: external/bsd/iscsi/dist/src/lib/conffile.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/iscsi/dist/src/lib/conffile.c,v
retrieving revision 1.2
diff -u -p -r1.2 conffile.c
--- external/bsd/iscsi/dist/src/lib/conffile.c 30 Jun 2009 02:44:52 -0000
1.2
+++ external/bsd/iscsi/dist/src/lib/conffile.c 1 Mar 2012 22:16:13 -0000
@@ -206,7 +206,7 @@ safe_write_ent(FILE *fp, conffile_t *sp,
#endif
/* report an error and clear up */
-static int
+static __printflike(3, 4) int
report_error(FILE *fp, char *name, const char *fmt, ...)
{
va_list vp;
Index: external/bsd/iscsi/dist/src/lib/disk.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/iscsi/dist/src/lib/disk.c,v
retrieving revision 1.6
diff -u -p -r1.6 disk.c
--- external/bsd/iscsi/dist/src/lib/disk.c 3 Mar 2010 00:44:51 -0000
1.6
+++ external/bsd/iscsi/dist/src/lib/disk.c 1 Mar 2012 22:16:13 -0000
@@ -1397,7 +1397,7 @@ disk_write(target_session_t *sess, iscsi
bytec, byte_offset);
if ((unsigned) bytec > MB(1)) {
- iscsi_err(__FILE__, __LINE__, "bytec > %u\n", bytec);
+ iscsi_err(__FILE__, __LINE__, "bytec > %" PRIu64 "m\n", bytec);
NO_CLEANUP;
return -1;
}
@@ -1480,7 +1480,7 @@ disk_read(target_session_t *sess, iscsi_
return -1;
}
if ((unsigned) bytec > MB(1)) {
- iscsi_err(__FILE__, __LINE__, "bytec > %u\n", bytec);
+ iscsi_err(__FILE__, __LINE__, "bytec > %" PRIu64 "\n", bytec);
NO_CLEANUP;
return -1;
}
Index: external/bsd/iscsi/dist/src/lib/initiator.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/iscsi/dist/src/lib/initiator.c,v
retrieving revision 1.7
diff -u -p -r1.7 initiator.c
--- external/bsd/iscsi/dist/src/lib/initiator.c 17 Feb 2012 12:08:12 -0000
1.7
+++ external/bsd/iscsi/dist/src/lib/initiator.c 1 Mar 2012 22:16:13 -0000
@@ -201,7 +201,7 @@ session_init_i(initiator_session_t ** se
int mutual_auth;
int one = 1;
- iscsi_trace(TRACE_ISCSI_DEBUG, "initializing session %llu\n", isid);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "initializing session %" PRIu64 "\n",
isid);
/* Get free session */
if ((*sess = iscsi_queue_remove(&g_session_q)) == NULL) {
@@ -294,7 +294,7 @@ session_init_i(initiator_session_t ** se
/* Start Tx worker */
- iscsi_trace(TRACE_ISCSI_DEBUG, "starting Tx worker %llu\n", isid);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "starting Tx worker %" PRIu64 "\n",
isid);
if (iscsi_queue_init(&s->tx_queue, CONFIG_INITIATOR_QUEUE_DEPTH) == -1)
{
iscsi_err(__FILE__, __LINE__, "iscsi_queue_init() failed\n");
return -1;
@@ -311,12 +311,12 @@ session_init_i(initiator_session_t ** se
ISCSI_UNLOCK(&s->tx_worker.exit_mutex, return -1);
if (s->state == INITIATOR_SESSION_STATE_DESTROYING) {
iscsi_trace(TRACE_ISCSI_DEBUG,
- "session %llu is being destroyed, exiting\n", isid);
+ "session %" PRIu64 " is being destroyed, exiting\n",
isid);
return -1;
}
if (s->tx_worker.state & ISCSI_WORKER_STATE_ERROR) {
iscsi_err(__FILE__, __LINE__,
- "Tx worker %llu started with an error\n", isid);
+ "Tx worker %" PRIu64 " started with an error\n", isid);
return -1;
}
iscsi_trace(TRACE_ISCSI_DEBUG, "got signal from Tx worker\n");
@@ -337,7 +337,7 @@ session_destroy_i(initiator_session_t *
}
if (g_target[(int)sess->isid].has_session == 0) {
iscsi_err(__FILE__, __LINE__,
- "g_target[%llu].has_session==0??\n", sess->isid);
+ "g_target[%" PRIu64 "].has_session==0??\n", sess->isid);
return -1;
}
sess->state = INITIATOR_SESSION_STATE_DESTROYING;
@@ -354,15 +354,15 @@ session_destroy_i(initiator_session_t *
if (sess->tx_worker.state & ISCSI_WORKER_STATE_STARTED) {
if (sess->tx_worker.state & ISCSI_WORKER_STATE_EXITING) {
iscsi_trace(TRACE_ISCSI_DEBUG,
- "Tx worker %llu already signalled for exit\n",
+ "Tx worker %" PRIu64 " already signalled for
exit\n",
sess->isid);
} else {
iscsi_trace(TRACE_ISCSI_DEBUG,
- "signaling Tx worker %llu into exiting state\n",
+ "signaling Tx worker %" PRIu64 " into exiting
state\n",
sess->isid);
ISCSI_LOCK(&sess->tx_worker.work_mutex, return -1);
iscsi_trace(TRACE_ISCSI_DEBUG,
- "signaling socket shutdown to Tx worker
%llu\n", sess->isid);
+ "signaling socket shutdown to Tx worker %"
PRIu64 "\n", sess->isid);
if (iscsi_sock_shutdown(sess->sock, 1) != 0) {
iscsi_err(__FILE__, __LINE__,
"iscsi_sock_shutdown() failed\n");
@@ -376,7 +376,7 @@ session_destroy_i(initiator_session_t *
ISCSI_WORKER_STATE_EXITING) {
ISCSI_SPIN;
}
- iscsi_trace(TRACE_ISCSI_DEBUG, "Tx worker %llu has exited\n",
+ iscsi_trace(TRACE_ISCSI_DEBUG, "Tx worker %" PRIu64 " has
exited\n",
sess->isid);
} else {
iscsi_trace(TRACE_ISCSI_DEBUG,
@@ -395,11 +395,11 @@ session_destroy_i(initiator_session_t *
if (sess->rx_worker.state & ISCSI_WORKER_STATE_STARTED) {
if (sess->rx_worker.state & ISCSI_WORKER_STATE_EXITING) {
iscsi_trace(TRACE_ISCSI_DEBUG,
- "Rx worker %llu already signalled for exit\n",
+ "Rx worker %" PRIu64 " already signalled for
exit\n",
sess->isid);
} else {
iscsi_trace(TRACE_ISCSI_DEBUG,
- "signaling Rx worker %llu into exiting
state\n", sess->isid);
+ "signaling Rx worker %" PRIu64 " into exiting
state\n", sess->isid);
if (iscsi_sock_shutdown(sess->sock, 0) != 0) {
iscsi_err(__FILE__, __LINE__,
"iscsi_sock_shutdown() failed\n");
@@ -411,7 +411,7 @@ session_destroy_i(initiator_session_t *
ISCSI_WORKER_STATE_EXITING) {
ISCSI_SPIN;
}
- iscsi_trace(TRACE_ISCSI_DEBUG, "Rx worker %llu has exited\n",
+ iscsi_trace(TRACE_ISCSI_DEBUG, "Rx worker %" PRIu64 " has
exited\n",
sess->isid);
} else {
iscsi_trace(TRACE_ISCSI_DEBUG,
@@ -561,7 +561,7 @@ full_feature_negotiation_phase_i(initiat
/* Enqueue initiator command to Tx worker */
iscsi_trace(TRACE_ISCSI_DEBUG,
- "enqueing text command to tx worker %llu\n",
+ "enqueing text command to tx worker %" PRIu64 "\n",
sess->isid);
ISCSI_LOCK(&iwait.mutex, FFN_ERROR);
ISCSI_LOCK(&sess->tx_worker.work_mutex, FFN_ERROR);
@@ -1091,7 +1091,7 @@ initiator_abort(initiator_cmd_t * cmd)
initiator_cmd_t *ptr, *prev;
initiator_session_t *sess;
- iscsi_err(__FILE__, __LINE__, "aborting iSCSI cmd 0x%p (type %d, isid
%llu)\n",
+ iscsi_err(__FILE__, __LINE__, "aborting iSCSI cmd 0x%p (type %d, isid
%" PRIu64 ")\n",
cmd, cmd->type, cmd->isid);
hash_remove(&g_tag_hash, cmd->key);
@@ -1123,7 +1123,7 @@ initiator_abort(initiator_cmd_t * cmd)
return -1;
}
}
- iscsi_err(__FILE__, __LINE__, "successfully aborted iSCSI cmd 0x%p
(type %d, isid %llu)\n",
+ iscsi_err(__FILE__, __LINE__, "successfully aborted iSCSI cmd 0x%p
(type %d, isid %" PRIu64 ")\n",
cmd, cmd->type, cmd->isid);
return 0;
}
@@ -1171,7 +1171,7 @@ initiator_enqueue(initiator_cmd_t * cmd)
uint32_t tag;
if ((target = cmd->isid) >= CONFIG_INITIATOR_NUM_TARGETS) {
- iscsi_err(__FILE__, __LINE__, "target (%d) out of range
[0..%d]\n", target, CONFIG_INITIATOR_NUM_TARGETS);
+ iscsi_err(__FILE__, __LINE__, "target (%" PRIu64 ") out of
range [0..%d]\n", target, CONFIG_INITIATOR_NUM_TARGETS);
return -1;
}
sess = g_target[(int)target].sess;
@@ -1205,7 +1205,7 @@ initiator_enqueue(initiator_cmd_t * cmd)
ISCSI_LOCK(&sess->tx_worker.work_mutex, return -1);
ISCSI_SIGNAL(&sess->tx_worker.work_cond, return -1);
ISCSI_UNLOCK(&sess->tx_worker.work_mutex, return -1);
- iscsi_trace(TRACE_ISCSI_DEBUG, "initiator_cmd_t 0x%p given to
tx_worker[%llu]\n", cmd, cmd->isid);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "initiator_cmd_t 0x%p given to
tx_worker[%" PRIu64 "]\n", cmd, cmd->isid);
} else {
/*
@@ -1263,7 +1263,7 @@ enqueue_worker_proc(void *arg)
}
ISCSI_SET_TAG(&tag);
target = cmd->isid;
- iscsi_trace(TRACE_ISCSI_CMD, "enqueue_worker: dequeued
initiator_cmd_t 0x%p (type %d, target %llu)\n", cmd, cmd->type, target);
+ iscsi_trace(TRACE_ISCSI_CMD, "enqueue_worker: dequeued
initiator_cmd_t 0x%p (type %d, target %" PRIu64 ")\n", cmd, cmd->type, target);
switch (cmd->type) {
case ISCSI_SCSI_CMD:
scsi_cmd = (iscsi_scsi_cmd_args_t *) cmd->ptr;
@@ -1283,14 +1283,14 @@ enqueue_worker_proc(void *arg)
/* Initialize session (if not already) */
initialize:
if (!g_target[(int)target].has_session) {
- iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
initializing target %llu session\n", target);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
initializing target %" PRIu64 " session\n", target);
if (session_init_i(&g_target[(int)target].sess,
target) != 0) {
iscsi_err(__FILE__, __LINE__,
"session_init_i() failed (ignoring command)\n");
goto next;
}
- iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
target %llu session initialized\n", target);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
target %" PRIu64 " session initialized\n", target);
} else {
- iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
target %llu session already initialized\n", target);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
target %" PRIu64 " session already initialized\n", target);
}
sess = g_target[(int)target].sess;
iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker: session
0x%p\n", sess);
@@ -1298,7 +1298,7 @@ initialize:
/* Discovery login if TargetName is zero length */
if (strlen(g_target[(int)target].TargetName) == 0) {
- iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
entering Discovery phase with target %llu\n", target);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
entering Discovery phase with target %" PRIu64 "\n", target);
rc = discovery_phase((int)target,
&g_target[(int)target].all_targets);
iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
Discovery phase complete\n");
@@ -1331,12 +1331,12 @@ initialize:
/* Get into full feature if we're not already */
if (sess->state !=
INITIATOR_SESSION_STATE_LOGGED_IN_NORMAL) {
- iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
entering full feature with target %llu (sock %#x)\n", target, (int) sess->sock);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "enqueue_worker:
entering full feature with target %" PRIu64 " (sock %#x)\n", target, (int)
sess->sock);
if (full_feature_phase(sess) != 0) {
iscsi_err(__FILE__, __LINE__,
"enqueue_worker: full_feature_phase() failed (ignoring command)\n");
goto next;
} else {
- iscsi_trace(TRACE_ISCSI_DEBUG,
"enqueue_worker: now full feature with target %llu\n", target);
+ iscsi_trace(TRACE_ISCSI_DEBUG,
"enqueue_worker: now full feature with target %" PRIu64 "\n", target);
}
}
/*
@@ -1356,7 +1356,7 @@ initialize:
}
ISCSI_SIGNAL(&sess->tx_worker.work_cond, goto done);
ISCSI_UNLOCK(&sess->tx_worker.work_mutex, goto done);
- iscsi_trace(TRACE_ISCSI_CMD, "enqueue_worker: gave
initiator_cmd_t 0x%p to tx_worker[%llu]\n", cmd, cmd->isid);
+ iscsi_trace(TRACE_ISCSI_CMD, "enqueue_worker: gave
initiator_cmd_t 0x%p to tx_worker[%" PRIu64 "]\n", cmd, cmd->isid);
next:
ISCSI_LOCK(&g_enqueue_worker.work_mutex, goto done);
} else {
@@ -1465,13 +1465,13 @@ tx_worker_proc_i(void *arg)
ISCSI_UNLOCK(&me->work_mutex, return -1);
iscsi_trace(TRACE_ISCSI_CMD,
"tx_worker[%d]: dequeued initiator_cmd_t 0x%p "
- "(type %d, target %llu)\n",
+ "(type %d, target %" PRIu64 ")\n",
me->id, cmd, cmd->type, cmd->isid);
/* Make sure we've got the right command */
if (cmd->isid != (unsigned)me->id) {
iscsi_err(__FILE__, __LINE__,
- "got command %#x for target %llu, "
+ "got command %#x for target %" PRIu64
", "
"expected %d\n", cmd->type,
cmd->isid, me->id);
goto done;
@@ -1902,7 +1902,7 @@ logout_phase_i(initiator_session_t * ses
/* Enqueue to Tx worker */
- iscsi_trace(TRACE_ISCSI_DEBUG, "enqueing logout command to tx worker
%llu\n", sess->isid);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "enqueing logout command to tx worker %"
PRIu64 "\n", sess->isid);
ISCSI_LOCK(&iwait.mutex, LO_ERROR);
ISCSI_LOCK(&sess->tx_worker.work_mutex, LO_ERROR);
if (iscsi_queue_insert(&sess->tx_queue, cmd) == -1) {
@@ -2016,7 +2016,7 @@ login_phase_i(initiator_session_t * sess
/* Enqueue initiator command to Tx worker */
- iscsi_trace(TRACE_ISCSI_DEBUG, "enqueing login command to tx
worker %llu\n", sess->isid);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "enqueing login command to tx
worker %" PRIu64 "\n", sess->isid);
ISCSI_LOCK(&iwait.mutex, LI_ERROR);
ISCSI_LOCK(&sess->tx_worker.work_mutex, LI_ERROR);
if (iscsi_queue_insert(&sess->tx_queue, cmd) == -1) {
@@ -2284,8 +2284,7 @@ login_response_i(initiator_session_t * s
}
if (login_rsp.isid != login_cmd->isid) {
iscsi_err(__FILE__, __LINE__,
- "Bad \"ISID\": %" PRIu64 "u != %"
- PRIu64 "u.\n",
+ "Bad \"ISID\": %uu != %uu.\n",
(unsigned)login_rsp.isid,
(unsigned)login_cmd->isid);
LIR_ERROR;
@@ -2324,7 +2323,7 @@ login_response_i(initiator_session_t * s
iscsi_trace(TRACE_ISCSI_DEBUG,
"*********************************************\n");
iscsi_trace(TRACE_ISCSI_DEBUG, "* LOGIN
SUCCESSFUL *\n");
iscsi_trace(TRACE_ISCSI_DEBUG, "* %20s:%20u *\n",
"CID", sess->cid);
- iscsi_trace(TRACE_ISCSI_DEBUG, "* %20s:%20llu *\n",
"ISID", sess->isid);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "* %20s:%20" PRIu64 "
*\n", "ISID", sess->isid);
iscsi_trace(TRACE_ISCSI_DEBUG, "* %20s:%20u *\n",
"TSIH", sess->tsih);
iscsi_trace(TRACE_ISCSI_DEBUG, "* %20s:%20u *\n",
"CmdSN", sess->CmdSN);
iscsi_trace(TRACE_ISCSI_DEBUG, "* %20s:%20u *\n",
"MaxCmdSN", sess->MaxCmdSN);
@@ -2469,7 +2468,7 @@ callback:
iscsi_trace(TRACE_ISCSI_DEBUG,
"*********************************************\n");
iscsi_trace(TRACE_ISCSI_DEBUG, "* LOGOUT SUCCESSFUL
*\n");
iscsi_trace(TRACE_ISCSI_DEBUG, "* %20s:%20u *\n", "CID", sess->cid);
- iscsi_trace(TRACE_ISCSI_DEBUG, "* %20s:%20llu *\n", "ISID", sess->isid);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "* %20s:%20" PRIu64 " *\n", "ISID",
sess->isid);
iscsi_trace(TRACE_ISCSI_DEBUG, "* %20s:%20u *\n", "TSIH", sess->tsih);
iscsi_trace(TRACE_ISCSI_DEBUG,
"*********************************************\n");
@@ -2549,7 +2548,7 @@ scsi_command_i(initiator_cmd_t * cmd)
sg_len = sg_len_copy = sg_len_which = 0;
scsi_cmd->status = 0;
- iscsi_trace(TRACE_ISCSI_DEBUG, "tx_worker[%llu]: scsi op %#x lun %llu
trans_len %d length %d send_sg_len %d recv_sg_len %d\n", target,
scsi_cmd->cdb[0], scsi_cmd->lun, scsi_cmd->trans_len, scsi_cmd->length,
scsi_cmd->send_sg_len, scsi_cmd->recv_sg_len);
+ iscsi_trace(TRACE_ISCSI_DEBUG, "tx_worker[%" PRIu64 "]: scsi op %#x lun
%" PRIu64 " trans_len %d length %d send_sg_len %d recv_sg_len %d\n", target,
scsi_cmd->cdb[0], scsi_cmd->lun, scsi_cmd->trans_len, scsi_cmd->length,
scsi_cmd->send_sg_len, scsi_cmd->recv_sg_len);
if ((uint32_t)target > CONFIG_INITIATOR_NUM_TARGETS) {
iscsi_err(__FILE__, __LINE__, "target %u\n",
@@ -3282,7 +3281,7 @@ scsi_response_i(initiator_session_t * se
errmsg = "StatSN";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return -1;
}
@@ -3455,10 +3454,10 @@ scsi_read_data_i(initiator_session_t * s
errmsg = "Residual Count";
}
} else {
- iscsi_warn(__FILE__, __LINE__, "Underflow %s\n",
data.res_count);
+ iscsi_warn(__FILE__, __LINE__, "Underflow %" PRIu32 "\n",
data.res_count);
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return -1;
}
Index: external/bsd/iscsi/dist/src/lib/parameters.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/iscsi/dist/src/lib/parameters.c,v
retrieving revision 1.2
diff -u -p -r1.2 parameters.c
--- external/bsd/iscsi/dist/src/lib/parameters.c 30 Jun 2009 02:44:52
-0000 1.2
+++ external/bsd/iscsi/dist/src/lib/parameters.c 1 Mar 2012 22:16:13
-0000
@@ -821,7 +821,7 @@ param_text_parse(iscsi_parameter_t * hea
}
if (strlen(value) > ISCSI_PARAM_MAX_LEN) {
iscsi_err(__FILE__, __LINE__,
- "strlen(value) %u\n", strlen(value));
+ "strlen(value) %zu\n", strlen(value));
PTP_CLEANUP;
return -1;
}
Index: external/bsd/iscsi/dist/src/lib/protocol.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/iscsi/dist/src/lib/protocol.c,v
retrieving revision 1.2
diff -u -p -r1.2 protocol.c
--- external/bsd/iscsi/dist/src/lib/protocol.c 22 Feb 2011 13:10:55 -0000
1.2
+++ external/bsd/iscsi/dist/src/lib/protocol.c 1 Mar 2012 22:16:13 -0000
@@ -133,7 +133,7 @@ iscsi_task_cmd_decap(uint8_t *header, is
errmsg = "Bytes 40-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -211,7 +211,7 @@ iscsi_task_rsp_decap(uint8_t *header, is
errmsg = "Bytes 36-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -287,7 +287,7 @@ iscsi_nop_out_decap(uint8_t *header, isc
errmsg = "Bytes 32-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -364,7 +364,7 @@ iscsi_nop_in_decap(uint8_t *header, iscs
errmsg = "Bytes 36-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -452,7 +452,7 @@ iscsi_text_cmd_decap(uint8_t *header, is
errmsg = "Bytes 32-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -540,7 +540,7 @@ iscsi_text_rsp_decap(uint8_t *header, is
errmsg = "Bytes 36-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -657,7 +657,7 @@ iscsi_login_cmd_decap(uint8_t *header, i
errmsg = "Bytes 32-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -783,7 +783,7 @@ iscsi_login_rsp_decap(uint8_t *header, i
errmsg = "Bytes 40-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -862,7 +862,7 @@ iscsi_logout_cmd_decap(uint8_t *header,
errmsg = "Bytes 32-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -940,7 +940,7 @@ iscsi_logout_rsp_decap(uint8_t *header,
errmsg = "Bytes 44-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -1041,7 +1041,7 @@ iscsi_scsi_cmd_decap(uint8_t *header, is
errmsg = "Byte 3";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -1157,7 +1157,7 @@ iscsi_scsi_rsp_decap(uint8_t *header, is
errmsg = "overflow";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -1252,7 +1252,7 @@ iscsi_r2t_decap(uint8_t *header, iscsi_r
errmsg = "Bytes 4-15";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -1339,7 +1339,7 @@ iscsi_write_data_decap(uint8_t *header,
errmsg = "Bytes 44-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -1461,7 +1461,7 @@ iscsi_read_data_decap(uint8_t *header, i
errmsg = "Bytes 44-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
@@ -1546,7 +1546,7 @@ iscsi_reject_decap(uint8_t *header, iscs
errmsg = "Bytes 40-47";
}
if (errmsg) {
- iscsi_err(__FILE__, __LINE__, errmsg);
+ iscsi_err(__FILE__, __LINE__, "%s", errmsg);
NO_CLEANUP;
return 1;
}
Index: external/bsd/iscsi/dist/src/lib/util.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/iscsi/dist/src/lib/util.c,v
retrieving revision 1.2
diff -u -p -r1.2 util.c
--- external/bsd/iscsi/dist/src/lib/util.c 30 Jun 2009 02:44:52 -0000
1.2
+++ external/bsd/iscsi/dist/src/lib/util.c 1 Mar 2012 22:16:13 -0000
@@ -467,7 +467,7 @@ modify_iov(struct iovec ** iov_ptr, int
}
if (i == *iovc) {
iscsi_err(__FILE__, __LINE__,
- "sum of iov lens (%u) < offset (%u)\n", len, offset);
+ "sum of iov lens (%zu) < offset (%u)\n", len, offset);
return -1;
}
iov[i].iov_len -= disp;
@@ -493,7 +493,7 @@ modify_iov(struct iovec ** iov_ptr, int
}
if (i == *iovc) {
iscsi_err(__FILE__, __LINE__,
- "sum of iovec lens (%u) < length (%u)\n", len, length);
+ "sum of iovec lens (%zu) < length (%u)\n", len, length);
for (i = 0; i < *iovc; i++) {
iscsi_err(__FILE__, __LINE__,
"iov[%d].iov_base = %p (len %u)\n",
@@ -512,7 +512,7 @@ modify_iov(struct iovec ** iov_ptr, int
i, iov[i].iov_base, (unsigned)iov[i].iov_len);
len += iov[i].iov_len;
}
- iscsi_trace(TRACE_NET_IOV, "new iov length: %u bytes\n", len);
+ iscsi_trace(TRACE_NET_IOV, "new iov length: %zu bytes\n", len);
#endif
return 0;
@@ -960,7 +960,7 @@ iscsi_sock_msg(int sock, int xmit, unsig
}
if (total_len != len - n) {
iscsi_err(__FILE__, __LINE__,
- "iovcs sum to %u != total len of %u\n",
+ "iovcs sum to %zu != total len of %u\n",
total_len, len - n);
iscsi_err(__FILE__, __LINE__, "iov = %p\n", iov);
for (i = 0; i < iovc; i++) {
@@ -995,7 +995,7 @@ iscsi_sock_msg(int sock, int xmit, unsig
}
iscsi_trace(TRACE_NET_IOV,
"before modify_iov: %s %d buffers, "
- "total_len = %u, n = %u, rc = %u\n",
+ "total_len = %zu, n = %u, rc = %u\n",
xmit ? "gathering from" : "scattering into",
iovc, total_len, n, rc);
if (modify_iov(&iov, &iovc, (unsigned) rc, len - n)
@@ -1010,7 +1010,7 @@ iscsi_sock_msg(int sock, int xmit, unsig
}
iscsi_trace(TRACE_NET_IOV,
"after modify_iov: %s %d buffers, "
- "total_len = %u, n = %u, rc = %u\n\n",
+ "total_len = %zu, n = %u, rc = %u\n\n",
xmit ? "gathering from" : "scattering into",
iovc, total_len, n, rc);
}
Index: external/bsd/libarchive/dist/libarchive_fe/err.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/libarchive/dist/libarchive_fe/err.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 err.c
--- external/bsd/libarchive/dist/libarchive_fe/err.c 20 Feb 2010 02:49:07
-0000 1.1.1.1
+++ external/bsd/libarchive/dist/libarchive_fe/err.c 1 Mar 2012 22:16:13
-0000
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
const char *lafe_progname;
-static void
+static __printflike(2, 0) void
lafe_vwarnc(int code, const char *fmt, va_list ap)
{
fprintf(stderr, "%s: ", lafe_progname);
Index: external/bsd/libarchive/dist/libarchive_fe/err.h
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/libarchive/dist/libarchive_fe/err.h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 err.h
--- external/bsd/libarchive/dist/libarchive_fe/err.h 20 Feb 2010 02:49:07
-0000 1.1.1.1
+++ external/bsd/libarchive/dist/libarchive_fe/err.h 1 Mar 2012 22:16:13
-0000
@@ -35,7 +35,8 @@
extern const char *lafe_progname;
-void lafe_warnc(int code, const char *fmt, ...);
-void lafe_errc(int eval, int code, const char *fmt, ...) __LA_DEAD;
+void lafe_warnc(int code, const char *fmt, ...) __printflike(2, 3);
+void lafe_errc(int eval, int code, const char *fmt, ...) __LA_DEAD
+ __printflike(3, 4);
#endif
Index: external/bsd/libevent/dist/event.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/libevent/dist/event.h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 event.h
--- external/bsd/libevent/dist/event.h 2 Nov 2009 10:00:58 -0000 1.1.1.1
+++ external/bsd/libevent/dist/event.h 1 Mar 2012 22:16:13 -0000
@@ -1062,7 +1062,8 @@ int evbuffer_add_printf(struct evbuffer
@param ap a varargs va_list argument array that will be passed to vprintf(3)
@return The number of bytes added if successful, or -1 if an error occurred.
*/
-int evbuffer_add_vprintf(struct evbuffer *, const char *fmt, va_list ap);
+int evbuffer_add_vprintf(struct evbuffer *, const char *fmt, va_list ap)
+ __printflike(2, 0);
/**
Index: external/bsd/libevent/dist/evutil.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/libevent/dist/evutil.h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 evutil.h
--- external/bsd/libevent/dist/evutil.h 2 Nov 2009 10:00:59 -0000 1.1.1.1
+++ external/bsd/libevent/dist/evutil.h 1 Mar 2012 22:16:13 -0000
@@ -177,7 +177,11 @@ int evutil_snprintf(char *buf, size_t bu
__attribute__((format(printf, 3, 4)))
#endif
;
-int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap);
+int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
+#ifdef __GNUC__
+ __attribute__((format(printf, 3, 0)))
+#endif
+ ;
#ifdef __cplusplus
}
Index: external/bsd/libevent/dist/log.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/libevent/dist/log.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 log.c
--- external/bsd/libevent/dist/log.c 2 Nov 2009 10:01:01 -0000 1.1.1.1
+++ external/bsd/libevent/dist/log.c 1 Mar 2012 22:16:13 -0000
@@ -64,7 +64,7 @@
#include "evutil.h"
static void _warn_helper(int severity, int log_errno, const char *fmt,
- va_list ap);
+ va_list ap) __printflike(3, 0);
static void event_log(int severity, const char *msg);
void
Index: external/bsd/mdocml/dist/html.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/mdocml/dist/html.c,v
retrieving revision 1.1.1.14
diff -u -p -r1.1.1.14 html.c
--- external/bsd/mdocml/dist/html.c 11 Oct 2011 19:09:36 -0000 1.1.1.14
+++ external/bsd/mdocml/dist/html.c 1 Mar 2012 22:16:13 -0000
@@ -664,7 +664,7 @@ buffmt_man(struct html *h,
bufcat(h, sec ? sec : "1");
break;
case('N'):
- bufcat_fmt(h, name);
+ bufcat_fmt(h, "%s", name);
break;
default:
bufncat(h, p, 2);
Index: external/bsd/mdocml/dist/html.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/mdocml/dist/html.h,v
retrieving revision 1.1.1.12
diff -u -p -r1.1.1.12 html.h
--- external/bsd/mdocml/dist/html.h 11 Oct 2011 19:09:36 -0000 1.1.1.12
+++ external/bsd/mdocml/dist/html.h 1 Mar 2012 22:16:13 -0000
@@ -145,6 +145,9 @@ void print_tblclose(struct html *);
void print_tbl(struct html *, const struct tbl_span *);
void print_eqn(struct html *, const struct eqn *);
+#ifdef __GNUC__
+__attribute__((__format__(__printf__, 2, 3)))
+#endif
void bufcat_fmt(struct html *, const char *, ...);
void bufcat(struct html *, const char *);
void bufcat_id(struct html *, const char *);
Index: external/bsd/mdocml/dist/libmandoc.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/mdocml/dist/libmandoc.h,v
retrieving revision 1.1.1.9
diff -u -p -r1.1.1.9 libmandoc.h
--- external/bsd/mdocml/dist/libmandoc.h 30 Jan 2012 16:44:17 -0000
1.1.1.9
+++ external/bsd/mdocml/dist/libmandoc.h 1 Mar 2012 22:16:13 -0000
@@ -42,6 +42,9 @@ struct man;
void mandoc_msg(enum mandocerr, struct mparse *,
int, int, const char *);
+#ifdef __GNUC__
+__attribute__((__format__(__printf__, 5, 6)))
+#endif
void mandoc_vmsg(enum mandocerr, struct mparse *,
int, int, const char *, ...);
char *mandoc_getarg(struct mparse *, char **, int, int *);
Index: external/bsd/mdocml/dist/term_ps.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/mdocml/dist/term_ps.c,v
retrieving revision 1.1.1.7
diff -u -p -r1.1.1.7 term_ps.c
--- external/bsd/mdocml/dist/term_ps.c 30 Jan 2012 16:44:17 -0000 1.1.1.7
+++ external/bsd/mdocml/dist/term_ps.c 1 Mar 2012 22:16:13 -0000
@@ -97,6 +97,9 @@ static void ps_growbuf(struct termp *
static void ps_letter(struct termp *, int);
static void ps_pclose(struct termp *);
static void ps_pletter(struct termp *, int);
+#ifdef __GNUC__
+__attribute__((__format__(__printf__, 2, 3)))
+#endif
static void ps_printf(struct termp *, const char *, ...);
static void ps_putchar(struct termp *, char);
static void ps_setfont(struct termp *, enum termfont);
@@ -824,7 +827,7 @@ ps_begin(struct termp *p)
ps_printf(p, "<<\n");
ps_printf(p, "/Type /Font\n");
ps_printf(p, "/Subtype /Type1\n");
- ps_printf(p, "/Name /F%zu\n", i);
+ ps_printf(p, "/Name /F%u\n", i);
ps_printf(p, "/BaseFont /%s\n", fonts[i].name);
ps_printf(p, ">>\n");
}
Index: external/bsd/ntp/dist/ntpd/refclock_true.c
===================================================================
RCS file:
/home/joerg/repo/netbsd/src/external/bsd/ntp/dist/ntpd/refclock_true.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 refclock_true.c
--- external/bsd/ntp/dist/ntpd/refclock_true.c 31 Jan 2012 21:26:30 -0000
1.1.1.2
+++ external/bsd/ntp/dist/ntpd/refclock_true.c 1 Mar 2012 22:16:13 -0000
@@ -203,7 +203,7 @@ struct refclock refclock_true = {
#if !defined(__STDC__)
# define true_debug (void)
#else
-static void
+static __printflike(2, 3) void
true_debug(struct peer *peer, const char *fmt, ...)
{
va_list ap;
Index: external/bsd/pkg_install/dist/lib/lib.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/pkg_install/dist/lib/lib.h,v
retrieving revision 1.6
diff -u -p -r1.6 lib.h
--- external/bsd/pkg_install/dist/lib/lib.h 26 Jun 2010 00:17:13 -0000
1.6
+++ external/bsd/pkg_install/dist/lib/lib.h 1 Mar 2012 22:16:13 -0000
@@ -421,7 +421,7 @@ char *xstrdup(const char *);
void *xrealloc(void *, size_t);
void *xcalloc(size_t, size_t);
void *xmalloc(size_t);
-char *xasprintf(const char *, ...);
+char *xasprintf(const char *, ...) __printflike(1, 2);
/* Externs */
extern Boolean Verbose;
Index: external/bsd/tmux/dist/input.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/tmux/dist/input.c,v
retrieving revision 1.4
diff -u -p -r1.4 input.c
--- external/bsd/tmux/dist/input.c 17 Aug 2011 19:28:36 -0000 1.4
+++ external/bsd/tmux/dist/input.c 1 Mar 2012 22:16:13 -0000
@@ -49,7 +49,7 @@
/* Helper functions. */
int input_split(struct input_ctx *);
int input_get(struct input_ctx *, u_int, int, int);
-void input_reply(struct input_ctx *, const char *, ...);
+void input_reply(struct input_ctx *, const char *, ...) __printflike(2, 3);
/* Transition entry/exit handlers. */
void input_clear(struct input_ctx *);
Index: external/bsd/tmux/dist/log.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/tmux/dist/log.c,v
retrieving revision 1.2
diff -u -p -r1.2 log.c
--- external/bsd/tmux/dist/log.c 25 Aug 2011 16:41:51 -0000 1.2
+++ external/bsd/tmux/dist/log.c 1 Mar 2012 22:16:13 -0000
@@ -39,8 +39,8 @@ FILE *log_file;
/* Debug level. */
int log_level;
-void log_vwrite(int, const char *, va_list);
-__dead void log_vfatal(const char *, va_list);
+__printflike(3, 0) void log_vwrite(int, const char *, const char *,
va_list, const char *);
+__printflike(1, 0) __dead void log_vfatal(const char *, va_list);
/* Open logging to tty. */
void
@@ -83,7 +83,8 @@ log_close(void)
/* Write a log message. */
void
-log_vwrite(int pri, const char *msg, va_list ap)
+log_vwrite(int pri, const char *header, const char *msg, va_list ap,
+ const char *footer)
{
FILE *f = log_file;
@@ -95,8 +96,12 @@ log_vwrite(int pri, const char *msg, va_
f = stderr;
/* FALLTHROUGH */
case LOG_TYPE_FILE:
+ if (header && fputs(header, stdout) == -1)
+ exit(1);
if (vfprintf(f, msg, ap) == -1)
exit(1);
+ if (footer && fputs(footer, stdout) == -1)
+ exit(1);
if (putc('\n', f) == -1)
exit(1);
fflush(f);
@@ -109,13 +114,13 @@ void printflike1
log_warn(const char *msg, ...)
{
va_list ap;
- char *fmt;
+ char *extra;
va_start(ap, msg);
- if (asprintf(&fmt, "%s: %s", msg, strerror(errno)) == -1)
+ if (asprintf(&extra, ": %s", strerror(errno)) == -1)
exit(1);
- log_vwrite(LOG_CRIT, fmt, ap);
- free(fmt);
+ log_vwrite(LOG_CRIT, NULL, msg, ap, extra);
+ free(extra);
va_end(ap);
}
@@ -126,7 +131,7 @@ log_warnx(const char *msg, ...)
va_list ap;
va_start(ap, msg);
- log_vwrite(LOG_CRIT, msg, ap);
+ log_vwrite(LOG_CRIT, NULL, msg, ap, NULL);
va_end(ap);
}
@@ -138,7 +143,7 @@ log_info(const char *msg, ...)
if (log_level > -1) {
va_start(ap, msg);
- log_vwrite(LOG_INFO, msg, ap);
+ log_vwrite(LOG_INFO, NULL, msg, ap, NULL);
va_end(ap);
}
}
@@ -151,7 +156,7 @@ log_debug(const char *msg, ...)
if (log_level > 0) {
va_start(ap, msg);
- log_vwrite(LOG_DEBUG, msg, ap);
+ log_vwrite(LOG_DEBUG, NULL, msg, ap, NULL);
va_end(ap);
}
}
@@ -164,7 +169,7 @@ log_debug2(const char *msg, ...)
if (log_level > 1) {
va_start(ap, msg);
- log_vwrite(LOG_DEBUG, msg, ap);
+ log_vwrite(LOG_DEBUG, NULL, msg, ap, NULL);
va_end(ap);
}
}
@@ -173,18 +178,16 @@ log_debug2(const char *msg, ...)
__dead void
log_vfatal(const char *msg, va_list ap)
{
- char *fmt;
+ char *extra;
if (errno != 0) {
- if (asprintf(&fmt, "fatal: %s: %s", msg, strerror(errno)) == -1)
+ if (asprintf(&extra, ": %s", strerror(errno)) == -1)
exit(1);
- log_vwrite(LOG_CRIT, fmt, ap);
+ log_vwrite(LOG_CRIT, "fatal: ", msg, ap, extra);
+ free(extra);
} else {
- if (asprintf(&fmt, "fatal: %s", msg) == -1)
- exit(1);
- log_vwrite(LOG_CRIT, fmt, ap);
+ log_vwrite(LOG_CRIT, "fatal: ", msg, ap, NULL);
}
- free(fmt);
exit(1);
}
Index: external/bsd/tmux/dist/tmux.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/external/bsd/tmux/dist/tmux.h,v
retrieving revision 1.3
diff -u -p -r1.3 tmux.h
--- external/bsd/tmux/dist/tmux.h 17 Sep 2011 01:50:08 -0000 1.3
+++ external/bsd/tmux/dist/tmux.h 1 Mar 2012 22:16:13 -0000
@@ -1804,7 +1804,8 @@ void printflike3 screen_write_puts(struc
void printflike5 screen_write_nputs(struct screen_write_ctx *,
ssize_t, struct grid_cell *, int, const char *, ...);
void screen_write_vnputs(struct screen_write_ctx *,
- ssize_t, struct grid_cell *, int, const char *, va_list);
+ ssize_t, struct grid_cell *, int, const char *, va_list)
+ __printflike(5, 0);
void screen_write_parsestyle(
struct grid_cell *, struct grid_cell *, const char *);
void screen_write_putc(
@@ -1980,14 +1981,17 @@ extern const struct window_mode window_c
extern const struct window_mode window_copy_mode;
void window_copy_init_from_pane(struct window_pane *);
void window_copy_init_for_output(struct window_pane *);
-void window_copy_add(struct window_pane *, const char *, ...);
-void window_copy_vadd(struct window_pane *, const char *, va_list);
+void window_copy_add(struct window_pane *, const char *, ...)
+ __printflike(2, 0);
+void window_copy_vadd(struct window_pane *, const char *, va_list)
+ __printflike(2, 0);
void window_copy_pageup(struct window_pane *);
/* window-choose.c */
extern const struct window_mode window_choose_mode;
void window_choose_vadd(
- struct window_pane *, int, const char *, va_list);
+ struct window_pane *, int, const char *, va_list)
+ __printflike(3, 0);
void printflike3 window_choose_add(
struct window_pane *, int, const char *, ...);
void window_choose_ready(struct window_pane *,
@@ -2066,9 +2070,9 @@ void *xmalloc(size_t);
void *xrealloc(void *, size_t, size_t);
void xfree(void *);
int printflike2 xasprintf(char **, const char *, ...);
-int xvasprintf(char **, const char *, va_list);
+int xvasprintf(char **, const char *, va_list) __printflike(2, 0);
int printflike3 xsnprintf(char *, size_t, const char *, ...);
-int xvsnprintf(char *, size_t, const char *, va_list);
+int xvsnprintf(char *, size_t, const char *, va_list)
__printflike(3, 0);
/* utmp.c */
struct window_utmp *utmp_create(const char *);
Index: lib/libpuffs/opdump.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/lib/libpuffs/opdump.c,v
retrieving revision 1.35
diff -u -p -r1.35 opdump.c
--- lib/libpuffs/opdump.c 20 Aug 2010 16:35:05 -0000 1.35
+++ lib/libpuffs/opdump.c 1 Mar 2012 22:16:18 -0000
@@ -148,7 +148,7 @@ const char *puffsdump_flush_revmap[] = {
};
size_t puffsdump_flush_count = __arraycount(puffsdump_flush_revmap);
-static void
+static __printflike(1, 2) void
mydprintf(const char *fmt, ...)
{
va_list ap;
Index: lib/lua/gpio/gpio.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/lib/lua/gpio/gpio.c,v
retrieving revision 1.6
diff -u -p -r1.6 gpio.c
--- lib/lua/gpio/gpio.c 13 Nov 2011 16:56:15 -0000 1.6
+++ lib/lua/gpio/gpio.c 1 Mar 2012 22:16:18 -0000
@@ -45,7 +45,7 @@
#define GPIO_METATABLE "GPIO object methods"
-static void
+static __printflike(2, 3) void
gpio_error(lua_State *L, const char *fmt, ...)
{
va_list ap;
Index: lib/lua/sqlite/sqlite.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/lib/lua/sqlite/sqlite.c,v
retrieving revision 1.3
diff -u -p -r1.3 sqlite.c
--- lib/lua/sqlite/sqlite.c 15 Oct 2011 12:58:20 -0000 1.3
+++ lib/lua/sqlite/sqlite.c 1 Mar 2012 22:16:18 -0000
@@ -42,7 +42,7 @@
int luaopen_sqlite(lua_State*);
-static void
+static __printflike(2, 3) void
sqlite_error(lua_State *L, const char *fmt, ...)
{
va_list ap;
Index: libexec/fingerd/fingerd.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/libexec/fingerd/fingerd.c,v
retrieving revision 1.26
diff -u -p -r1.26 fingerd.c
--- libexec/fingerd/fingerd.c 27 Aug 2011 15:08:58 -0000 1.26
+++ libexec/fingerd/fingerd.c 1 Mar 2012 22:16:18 -0000
@@ -58,7 +58,7 @@ __RCSID("$NetBSD: fingerd.c,v 1.26 2011/
#include <string.h>
#include "pathnames.h"
-__dead static void my_err(const char *, ...);
+__dead static void my_err(const char *, ...) __printflike(1, 2);
int
main(int argc, char *argv[])
Index: libexec/httpd/bozohttpd.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/libexec/httpd/bozohttpd.h,v
retrieving revision 1.21
diff -u -p -r1.21 bozohttpd.h
--- libexec/httpd/bozohttpd.h 20 Feb 2012 09:26:56 -0000 1.21
+++ libexec/httpd/bozohttpd.h 1 Mar 2012 22:16:18 -0000
@@ -278,7 +278,7 @@ void bozo_add_content_map_mime(bozohttpd
#endif
/* I/O */
-int bozo_printf(bozohttpd_t *, const char *, ...);
+int bozo_printf(bozohttpd_t *, const char *, ...) __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 *);
Index: libexec/httpd/ssl-bozo.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/libexec/httpd/ssl-bozo.c,v
retrieving revision 1.14
diff -u -p -r1.14 ssl-bozo.c
--- libexec/httpd/ssl-bozo.c 20 Feb 2012 08:40:46 -0000 1.14
+++ libexec/httpd/ssl-bozo.c 1 Mar 2012 22:16:20 -0000
@@ -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
+__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 cod
exit(code);
}
-static int
+__printflike(2, 0) static int
bozo_ssl_printf(bozohttpd_t *httpd, const char * fmt, va_list ap)
{
sslinfo_t *sslinfo;
Index: libexec/identd/identd.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/libexec/identd/identd.c,v
retrieving revision 1.33
diff -u -p -r1.33 identd.c
--- libexec/identd/identd.c 29 Aug 2011 20:41:06 -0000 1.33
+++ libexec/identd/identd.c 1 Mar 2012 22:16:20 -0000
@@ -63,7 +63,7 @@ static void random_string(char *, size_
static int change_format(const char *, struct passwd *, char *, size_t);
__dead static void timeout_handler(int);
__dead static void fatal(const char *);
-__dead static void die(const char *, ...);
+__dead static void die(const char *, ...) __printflike(1, 2);
static int bflag, eflag, fflag, iflag, Iflag;
static int lflag, Lflag, nflag, Nflag, rflag;
Index: libexec/identd/identd.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/libexec/identd/identd.h,v
retrieving revision 1.8
diff -u -p -r1.8 identd.h
--- libexec/identd/identd.h 3 Apr 2005 22:15:32 -0000 1.8
+++ libexec/identd/identd.h 1 Mar 2012 22:16:20 -0000
@@ -14,7 +14,7 @@
#define satosin6(sa) ((struct sockaddr_in6 *)(sa))
#define in_hosteq(s,t) ((s).s_addr == (t).s_addr)
-void maybe_syslog(int, const char *, ...);
+void maybe_syslog(int, const char *, ...) __printflike(2, 3);
#ifdef WITH_PF
int pf_natlookup(struct sockaddr_storage *, struct sockaddr *, int *);
Index: sbin/dkscan_bsdlabel/dkscan_util.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sbin/dkscan_bsdlabel/dkscan_util.h,v
retrieving revision 1.3
diff -u -p -r1.3 dkscan_util.h
--- sbin/dkscan_bsdlabel/dkscan_util.h 27 Aug 2011 16:43:07 -0000 1.3
+++ sbin/dkscan_bsdlabel/dkscan_util.h 1 Mar 2012 22:16:20 -0000
@@ -37,8 +37,8 @@ u_int dkcksum_sized(struct disklabel *,
int dkwedge_read(struct disk *pdk, struct vnode *vp, daddr_t blkno,
void *tbuf, size_t len);
int dkwedge_add(struct dkwedge_info *dkw);
-void aprint_error(const char *format, ...);
-void aprint_verbose(const char *format, ...);
+void aprint_error(const char *format, ...) __printflike(1, 2);
+void aprint_verbose(const char *format, ...) __printflike(1, 2);
extern int verbose; /* are we verbose? */
extern int no_action; /* don't do anything, just print info */
Index: sbin/fdisk/fdisk.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sbin/fdisk/fdisk.c,v
retrieving revision 1.138
diff -u -p -r1.138 fdisk.c
--- sbin/fdisk/fdisk.c 2 Dec 2011 15:21:15 -0000 1.138
+++ sbin/fdisk/fdisk.c 1 Mar 2012 22:16:20 -0000
@@ -286,7 +286,7 @@ static int read_s0(daddr_t, struct mbr_s
static int write_mbr(void);
static int read_gpt(daddr_t, struct gpt_hdr *);
static int delete_gpt(struct gpt_hdr *);
-static int yesno(const char *, ...);
+static int yesno(const char *, ...) __printflike(1, 2);
static int64_t decimal(const char *, int64_t, int, int64_t, int64_t);
#define DEC_SEC 1 /* asking for a sector number */
#define DEC_RND 2 /* round to end of first track
*/
Index: sbin/sysctl/sysctl.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sbin/sysctl/sysctl.c,v
retrieving revision 1.140
diff -u -p -r1.140 sysctl.c
--- sbin/sysctl/sysctl.c 12 Feb 2012 20:54:07 -0000 1.140
+++ sbin/sysctl/sysctl.c 1 Mar 2012 22:16:20 -0000
@@ -147,7 +147,7 @@ static void getdesc(int *, u_int, struct
static void trim_whitespace(char *, int);
static void sysctlerror(int);
static void sysctlparseerror(u_int, const char *);
-static void sysctlperror(const char *, ...);
+static void sysctlperror(const char *, ...) __printflike(1, 2);
#define EXIT(n) do { \
if (fn == NULL) exit(n); else return; } while (/*CONSTCOND*/0)
Index: sys/ddb/db_output.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/ddb/db_output.h,v
retrieving revision 1.20
diff -u -p -r1.20 db_output.h
--- sys/ddb/db_output.h 10 Feb 2012 02:14:23 -0000 1.20
+++ sys/ddb/db_output.h 1 Mar 2012 22:16:20 -0000
@@ -38,7 +38,7 @@ void db_force_whitespace(void);
void db_putchar(int);
int db_print_position(void);
void db_printf(const char *, ...) __printflike(1, 2);
-void db_vprintf(const char *, va_list);
+void db_vprintf(const char *, va_list) __printflike(1, 0);
void db_format_radix(char *, size_t, quad_t, int);
void db_format_hex(char *, size_t, quad_t, int);
void db_end_line(void);
Index: sys/rump/include/rump/rumpuser.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/rump/include/rump/rumpuser.h,v
retrieving revision 1.71
diff -u -p -r1.71 rumpuser.h
--- sys/rump/include/rump/rumpuser.h 28 Nov 2011 08:05:06 -0000 1.71
+++ sys/rump/include/rump/rumpuser.h 1 Mar 2012 22:16:20 -0000
@@ -108,7 +108,7 @@ void rumpuser_seterrno(int);
int rumpuser_writewatchfile_setup(int, int, intptr_t, int *);
int rumpuser_writewatchfile_wait(int, intptr_t *, int *);
-int rumpuser_dprintf(const char *, ...);
+int rumpuser_dprintf(const char *, ...) __printflike(1, 2);
int rumpuser_getnhostcpu(void);
Index: tests/h_macros.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/h_macros.h,v
retrieving revision 1.7
diff -u -p -r1.7 h_macros.h
--- tests/h_macros.h 16 Jun 2011 15:33:24 -0000 1.7
+++ tests/h_macros.h 1 Mar 2012 22:16:20 -0000
@@ -50,7 +50,7 @@ do {
\
ATF_REQUIRE_MSG(RZ_rv == 0, "%s: %s", #x, strerror(RZ_rv)); \
} while (/*CONSTCOND*/0)
-static __inline void
+static __inline __printflike(1, 2) void
atf_tc_fail_errno(const char *fmt, ...)
{
va_list ap;
Index: tests/fs/ffs/t_quota2_1.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/fs/ffs/t_quota2_1.c,v
retrieving revision 1.3
diff -u -p -r1.3 t_quota2_1.c
--- tests/fs/ffs/t_quota2_1.c 16 Jun 2011 15:33:24 -0000 1.3
+++ tests/fs/ffs/t_quota2_1.c 1 Mar 2012 22:16:20 -0000
@@ -72,10 +72,9 @@ ATF_TC(quota_##name);
\
\
ATF_TC_HEAD(quota_##name, tc) \
{ \
- char buf[1000]; \
- snprintf(buf, sizeof(buf), "test quotas with %d users and groups, " \
- descr, nent); \
- atf_tc_set_md_var(tc, "descr", buf); \
+ atf_tc_set_md_var(tc, "descr", \
+ "test quotas with %d users and groups, %s", \
+ nent, descr); \
} \
\
ATF_TC_BODY(quota_##name, tc) \
Index: tests/fs/ffs/t_quota2_remount.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/fs/ffs/t_quota2_remount.c,v
retrieving revision 1.3
diff -u -p -r1.3 t_quota2_remount.c
--- tests/fs/ffs/t_quota2_remount.c 16 Jun 2011 15:33:25 -0000 1.3
+++ tests/fs/ffs/t_quota2_remount.c 1 Mar 2012 22:16:20 -0000
@@ -104,10 +104,8 @@ ATF_TC(quota_##name);
\
\
ATF_TC_HEAD(quota_##name, tc) \
{ \
- char buf[1000]; \
- snprintf(buf, sizeof(buf), "test filesystem remount with quotas, " \
- descr); \
- atf_tc_set_md_var(tc, "descr", buf); \
+ atf_tc_set_md_var(tc, "descr", \
+ "test filesystem remount with quotas, %s", descr); \
} \
\
ATF_TC_BODY(quota_##name, tc) \
Index: tests/kernel/gen_t_subr_prf
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/kernel/gen_t_subr_prf,v
retrieving revision 1.1
diff -u -p -r1.1 gen_t_subr_prf
--- tests/kernel/gen_t_subr_prf 24 Nov 2011 01:46:40 -0000 1.1
+++ tests/kernel/gen_t_subr_prf 1 Mar 2012 22:16:20 -0000
@@ -24,8 +24,8 @@ static const char hexdigits[] = "0123456
typedef int device_t;
#define device_xname(a) ""
-int kprintf(const char *, int, void *, char *, va_list);
-void device_printf(device_t, const char *, ...);
+int kprintf(const char *, int, void *, char *, va_list) __printflike(1, 0);
+void device_printf(device_t, const char *, ...) __printflike(2, 3);
static void
empty(void)
Index: tests/lib/libc/gen/t_humanize_number.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/lib/libc/gen/t_humanize_number.c,v
retrieving revision 1.5
diff -u -p -r1.5 t_humanize_number.c
--- tests/lib/libc/gen/t_humanize_number.c 7 Jul 2011 09:49:59 -0000
1.5
+++ tests/lib/libc/gen/t_humanize_number.c 1 Mar 2012 22:16:20 -0000
@@ -112,7 +112,7 @@ const struct hnflags normal_flags[] = {
const char *formatflags(char *, size_t, const struct hnflags *, size_t, int);
void newline(void);
-void w_printf(const char *, ...);
+void w_printf(const char *, ...) __printflike(1, 2);
int main(int, char *[]);
const char *
@@ -226,7 +226,7 @@ ATF_TC_BODY(humanize_number_basic, tc)
(rv == -1 || strcmp(buf, ho->ho_retstr) == 0))
continue;
- w_printf("humanize_number(\"%s\", %d, %" PRId64 ",",
+ w_printf("humanize_number(\"%s\", %zu, %" PRId64 ",",
ho->ho_retstr, ho->ho_len, ho->ho_num);
w_printf("\"%s\",", ho->ho_suffix);
w_printf("%s,", formatflags(fbuf, sizeof(fbuf), scale_flags,
Index: tests/lib/libc/ssp/h_vsnprintf.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/lib/libc/ssp/h_vsnprintf.c,v
retrieving revision 1.2
diff -u -p -r1.2 h_vsnprintf.c
--- tests/lib/libc/ssp/h_vsnprintf.c 28 Dec 2010 16:18:46 -0000 1.2
+++ tests/lib/libc/ssp/h_vsnprintf.c 1 Mar 2012 22:16:20 -0000
@@ -35,7 +35,7 @@ __RCSID("$NetBSD: h_vsnprintf.c,v 1.2 20
#include <stdlib.h>
#include <stdarg.h>
-void wrap(size_t, const char *, ...);
+static void wrap(size_t, const char *, ...) __printflike(2, 3);
void
wrap(size_t len, const char *fmt, ...)
Index: tests/lib/libc/ssp/h_vsprintf.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/lib/libc/ssp/h_vsprintf.c,v
retrieving revision 1.2
diff -u -p -r1.2 h_vsprintf.c
--- tests/lib/libc/ssp/h_vsprintf.c 28 Dec 2010 16:18:46 -0000 1.2
+++ tests/lib/libc/ssp/h_vsprintf.c 1 Mar 2012 22:16:20 -0000
@@ -34,7 +34,7 @@ __RCSID("$NetBSD: h_vsprintf.c,v 1.2 201
#include <stdio.h>
#include <stdarg.h>
-static void wrap(const char *, ...);
+static void wrap(const char *, ...) __printflike(1, 2);
static void
wrap(const char *fmt, ...)
Index: tests/lib/libc/stdio/t_printf.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/lib/libc/stdio/t_printf.c,v
retrieving revision 1.4
diff -u -p -r1.4 t_printf.c
--- tests/lib/libc/stdio/t_printf.c 26 Feb 2012 23:14:26 -0000 1.4
+++ tests/lib/libc/stdio/t_printf.c 1 Mar 2012 22:16:20 -0000
@@ -41,7 +41,7 @@ ATF_TC_HEAD(snprintf_dotzero, tc)
{
atf_tc_set_md_var(tc, "descr", \
- "PR lib/32951: %.0f formats (0.0,0.5] to \"0.\"");
+ "PR lib/32951: %%.0f formats (0.0,0.5] to \"0.\"");
}
ATF_TC_BODY(snprintf_dotzero, tc)
Index: tests/lib/libc/stdio/t_scanf.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/lib/libc/stdio/t_scanf.c,v
retrieving revision 1.1
diff -u -p -r1.1 t_scanf.c
--- tests/lib/libc/stdio/t_scanf.c 8 Jul 2011 06:38:04 -0000 1.1
+++ tests/lib/libc/stdio/t_scanf.c 1 Mar 2012 22:16:20 -0000
@@ -39,7 +39,7 @@ ATF_TC_HEAD(sscanf_neghex, tc)
{
atf_tc_set_md_var(tc, "descr", \
- "PR lib/21691: %i and %x fail with negative hex numbers");
+ "PR lib/21691: %%i and %%x fail with negative hex numbers");
}
ATF_TC_BODY(sscanf_neghex, tc)
Index: tests/lib/libc/stdlib/t_getenv_thread.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/lib/libc/stdlib/t_getenv_thread.c,v
retrieving revision 1.1
diff -u -p -r1.1 t_getenv_thread.c
--- tests/lib/libc/stdlib/t_getenv_thread.c 15 Jul 2011 13:54:31 -0000
1.1
+++ tests/lib/libc/stdlib/t_getenv_thread.c 1 Mar 2012 22:16:20 -0000
@@ -140,13 +140,9 @@ thread_unsetenv(void *arg)
ATF_TC(getenv_r_thread);
ATF_TC_HEAD(getenv_r_thread, tc)
{
- char timeout[32];
atf_tc_set_md_var(tc, "descr", "Test getenv_r(3) with threads");
-
- (void)snprintf(timeout, sizeof(timeout), "%d", THREADED_RUN_TIME + 5);
-
- atf_tc_set_md_var(tc, "timeout", timeout);
+ atf_tc_set_md_var(tc, "timeout", "%d", THREADED_RUN_TIME + 5);
}
ATF_TC_BODY(getenv_r_thread, tc)
@@ -170,13 +166,8 @@ ATF_TC_BODY(getenv_r_thread, tc)
ATF_TC(putenv_thread);
ATF_TC_HEAD(putenv_thread, tc)
{
- char timeout[32];
-
atf_tc_set_md_var(tc, "descr", "Test concurrent access by putenv(3)");
-
- (void)snprintf(timeout, sizeof(timeout), "%d", THREADED_RUN_TIME + 5);
-
- atf_tc_set_md_var(tc, "timeout", timeout);
+ atf_tc_set_md_var(tc, "timeout", "%d", THREADED_RUN_TIME + 5);
}
ATF_TC_BODY(putenv_thread, tc)
@@ -200,13 +191,8 @@ ATF_TC_BODY(putenv_thread, tc)
ATF_TC(setenv_thread);
ATF_TC_HEAD(setenv_thread, tc)
{
- char timeout[32];
-
atf_tc_set_md_var(tc, "descr", "Test concurrent access by setenv(3)");
-
- (void)snprintf(timeout, sizeof(timeout), "%d", THREADED_RUN_TIME + 5);
-
- atf_tc_set_md_var(tc, "timeout", timeout);
+ atf_tc_set_md_var(tc, "timeout", "%d", THREADED_RUN_TIME + 5);
}
ATF_TC_BODY(setenv_thread, tc)
@@ -230,13 +216,8 @@ ATF_TC_BODY(setenv_thread, tc)
ATF_TC(unsetenv_thread);
ATF_TC_HEAD(unsetenv_thread, tc)
{
- char timeout[32];
-
atf_tc_set_md_var(tc, "descr", "Test unsetenv(3) with threads");
-
- (void)snprintf(timeout, sizeof(timeout), "%d", THREADED_RUN_TIME + 5);
-
- atf_tc_set_md_var(tc, "timeout", timeout);
+ atf_tc_set_md_var(tc, "timeout", "%d", THREADED_RUN_TIME + 5);
}
ATF_TC_BODY(unsetenv_thread, tc)
Index: tests/modules/t_modctl.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/tests/modules/t_modctl.c,v
retrieving revision 1.5
diff -u -p -r1.5 t_modctl.c
--- tests/modules/t_modctl.c 3 Nov 2010 16:10:23 -0000 1.5
+++ tests/modules/t_modctl.c 1 Mar 2012 22:16:20 -0000
@@ -214,8 +214,7 @@ k_helper_is_present(enum presence_check
* occurs when loading the module, an error message is printed and the
* test case is aborted.
*/
-static
-int
+static __printflike(3, 4) int
load(prop_dictionary_t props, bool fatal, const char *fmt, ...)
{
int err;
@@ -308,13 +307,13 @@ ATF_TC_BODY(cmd_load, tc)
require_modular();
- ATF_CHECK(load(NULL, false, "") == ENOENT);
+ ATF_CHECK(load(NULL, false, "%s", "") == ENOENT);
ATF_CHECK(load(NULL, false, "non-existent.o") == ENOENT);
for (i = 0; i < MAXPATHLEN - 1; i++)
longname[i] = 'a';
longname[MAXPATHLEN - 1] = '\0';
- ATF_CHECK(load(NULL, false, longname) == ENAMETOOLONG);
+ ATF_CHECK(load(NULL, false, "%s", longname) == ENAMETOOLONG);
ATF_CHECK(!k_helper_is_present(stat_check));
load(NULL, true, "%s/k_helper/k_helper.kmod",
Index: usr.bin/bthset/bthset.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.bin/bthset/bthset.c,v
retrieving revision 1.7
diff -u -p -r1.7 bthset.c
--- usr.bin/bthset/bthset.c 29 Aug 2011 13:47:16 -0000 1.7
+++ usr.bin/bthset/bthset.c 1 Mar 2012 22:16:20 -0000
@@ -69,7 +69,7 @@ static void do_ring(int, short, void *);
static void do_mixer(int, short, void *);
static void do_rfcomm(int, short, void *);
static void do_server(int, short, void *);
-static int send_rfcomm(const char *, ...);
+static int send_rfcomm(const char *, ...) __printflike(1, 2);
static int init_mixer(struct btsco_info *, const char *);
static int init_rfcomm(struct btsco_info *);
Index: usr.bin/getent/getent.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.bin/getent/getent.c,v
retrieving revision 1.18
diff -u -p -r1.18 getent.c
--- usr.bin/getent/getent.c 11 Oct 2011 19:24:43 -0000 1.18
+++ usr.bin/getent/getent.c 1 Mar 2012 22:16:23 -0000
@@ -175,7 +175,7 @@ parsenum(const char *word, unsigned long
* then the aliases (beginning with prefix, separated by sep),
* then a newline
*/
-static void
+static __printflike(4, 5) void
printfmtstrings(char *strings[], const char *prefix, const char *sep,
const char *fmt, ...)
{
Index: usr.bin/m4/extern.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.bin/m4/extern.h,v
retrieving revision 1.15
diff -u -p -r1.15 extern.h
--- usr.bin/m4/extern.h 6 Sep 2011 18:16:01 -0000 1.15
+++ usr.bin/m4/extern.h 1 Mar 2012 22:16:24 -0000
@@ -101,13 +101,14 @@ extern void pbnumbase(int, int, int);
extern void pbunsigned(unsigned long);
extern void pbstr(const char *);
extern void pushback(int);
-extern void *xalloc(size_t, const char *fmt, ...);
-extern void *xrealloc(void *, size_t, const char *fmt, ...);
+extern void *xalloc(size_t, const char *fmt, ...) __printflike(2, 3);
+extern void *xrealloc(void *, size_t, const char *fmt, ...)
+ __printflike(3, 4);
extern char *xstrdup(const char *);
extern void resizedivs(int);
extern size_t buffer_mark(void);
extern void dump_buffer(FILE *, size_t);
-extern void __dead m4errx(int, const char *, ...);
+extern void __dead m4errx(int, const char *, ...) __printflike(2, 3);
extern int obtain_char(struct input_file *);
extern void set_input(struct input_file *, FILE *, const char *);
Index: usr.bin/su/su_pam.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.bin/su/su_pam.c,v
retrieving revision 1.16
diff -u -p -r1.16 su_pam.c
--- usr.bin/su/su_pam.c 2 Oct 2010 10:55:36 -0000 1.16
+++ usr.bin/su/su_pam.c 1 Mar 2012 22:16:24 -0000
@@ -81,7 +81,7 @@ static const struct pam_conv pamc = { &o
#define ARGSTR ARGSTRX
#endif
-static void logit(const char *, ...);
+static void logit(const char *, ...) __printflike(1, 2);
int
main(int argc, char **argv)
Index: usr.sbin/cpuctl/cpuctl.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.sbin/cpuctl/cpuctl.h,v
retrieving revision 1.2
diff -u -p -r1.2 cpuctl.h
--- usr.sbin/cpuctl/cpuctl.h 16 Dec 2008 22:44:51 -0000 1.2
+++ usr.sbin/cpuctl/cpuctl.h 1 Mar 2012 22:16:25 -0000
@@ -26,11 +26,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-int aprint_normal(const char *, ...);
-int aprint_verbose(const char *, ...);
-int aprint_error(const char *, ...);
-int aprint_normal_dev(const char *, const char *, ...);
-int aprint_verbose_dev(const char *, const char *, ...);
-int aprint_error_dev(const char *, const char *, ...);
+int aprint_normal(const char *, ...) __printflike(1, 2);
+int aprint_verbose(const char *, ...) __printflike(1, 2);
+int aprint_error(const char *, ...) __printflike(1, 2);
+int aprint_normal_dev(const char *, const char *, ...) __printflike(2, 3);
+int aprint_verbose_dev(const char *, const char *, ...) __printflike(2, 3);
+int aprint_error_dev(const char *, const char *, ...) __printflike(2, 3);
void identifycpu(const char *);
Index: usr.sbin/envstat/config_lex.l
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.sbin/envstat/config_lex.l,v
retrieving revision 1.7
diff -u -p -r1.7 config_lex.l
--- usr.sbin/envstat/config_lex.l 15 Feb 2010 22:37:14 -0000 1.7
+++ usr.sbin/envstat/config_lex.l 1 Mar 2012 22:16:26 -0000
@@ -39,7 +39,7 @@ __RCSID("$NetBSD: config_lex.l,v 1.7 201
#include "config_yacc.h"
extern int yyline;
-extern int yyerror(const char *, ...);
+extern int yyerror(const char *, ...) __printflike(1, 2);
int yylex(void);
Index: usr.sbin/envstat/config_yacc.y
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.sbin/envstat/config_yacc.y,v
retrieving revision 1.4
diff -u -p -r1.4 config_yacc.y
--- usr.sbin/envstat/config_yacc.y 17 Jul 2008 16:24:55 -0000 1.4
+++ usr.sbin/envstat/config_yacc.y 1 Mar 2012 22:16:26 -0000
@@ -46,7 +46,7 @@ __RCSID("$NetBSD: config_yacc.y,v 1.4 20
int yylex(void);
int yyparse(void);
-int yyerror(const char *, ...);
+int yyerror(const char *, ...) __printflike(1, 2);
void yyrestart(FILE *);
int yyline;
Index: usr.sbin/ldpd/ldp_errors.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.sbin/ldpd/ldp_errors.c,v
retrieving revision 1.1
diff -u -p -r1.1 ldp_errors.c
--- usr.sbin/ldpd/ldp_errors.c 8 Dec 2010 07:20:14 -0000 1.1
+++ usr.sbin/ldpd/ldp_errors.c 1 Mar 2012 22:16:26 -0000
@@ -41,7 +41,7 @@
int debug_f = 0, warn_f = 0, syslog_f = 0;
-static void do_syslog(int, const char*, va_list);
+static void do_syslog(int, const char*, va_list) __printflike(2, 0);
void
debugp(const char *fmt, ...)
Index: usr.sbin/ldpd/ldp_errors.h
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.sbin/ldpd/ldp_errors.h,v
retrieving revision 1.2
diff -u -p -r1.2 ldp_errors.h
--- usr.sbin/ldpd/ldp_errors.h 14 Jun 2011 11:28:51 -0000 1.2
+++ usr.sbin/ldpd/ldp_errors.h 1 Mar 2012 22:16:26 -0000
@@ -52,8 +52,8 @@
void printtime(void);
-void debugp(const char *, ...);
-void fatalp(const char *, ...);
-void warnp(const char *, ...);
+void debugp(const char *, ...) __printflike(1, 2);
+void fatalp(const char *, ...) __printflike(1, 2);
+void warnp(const char *, ...) __printflike(1, 2);
#endif /* !_LDP_ERRORS_H_ */
Index: usr.sbin/ldpd/mpls_routes.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.sbin/ldpd/mpls_routes.c,v
retrieving revision 1.8
diff -u -p -r1.8 mpls_routes.c
--- usr.sbin/ldpd/mpls_routes.c 16 Jun 2011 20:42:15 -0000 1.8
+++ usr.sbin/ldpd/mpls_routes.c 1 Mar 2012 22:16:26 -0000
@@ -532,7 +532,7 @@ get_route(struct rt_msg * rg, union sock
}
if (rlen <= (int)sizeof(struct rt_msghdr)) {
- debugp("Got only %d bytes, expecting at least %u\n", rlen,
+ debugp("Got only %d bytes, expecting at least %zu\n", rlen,
sizeof(struct rt_msghdr));
return LDP_E_ROUTE_ERROR;
}
Index: usr.sbin/mtree/spec.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.sbin/mtree/spec.c,v
retrieving revision 1.79
diff -u -p -r1.79 spec.c
--- usr.sbin/mtree/spec.c 14 Feb 2011 16:27:58 -0000 1.79
+++ usr.sbin/mtree/spec.c 1 Mar 2012 22:16:26 -0000
@@ -101,7 +101,7 @@ static void set(char *, NODE *);
static void unset(char *, NODE *);
static void addchild(NODE *, NODE *);
static int nodecmp(const NODE *, const NODE *);
-static int appendfield(int, const char *, ...);
+static int appendfield(int, const char *, ...) __printflike(2, 3);
#define REPLACEPTR(x,v) do { if ((x)) free((x)); (x) = (v); } while (0)
Index: usr.sbin/powerd/powerd.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.sbin/powerd/powerd.c,v
retrieving revision 1.16
diff -u -p -r1.16 powerd.c
--- usr.sbin/powerd/powerd.c 19 Dec 2010 22:52:08 -0000 1.16
+++ usr.sbin/powerd/powerd.c 1 Mar 2012 22:16:26 -0000
@@ -75,7 +75,7 @@ static struct kevent *allocchange(void);
static int wait_for_events(struct kevent *, size_t);
static void dispatch_dev_power(struct kevent *);
static void dispatch_power_event_state_change(int, power_event_t *);
-static void powerd_log(int, const char *, ...);
+static void powerd_log(int, const char *, ...) __printflike(2, 3);
static const char *script_paths[] = {
NULL,
Index: usr.sbin/ypserv/ypserv/ypserv.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/usr.sbin/ypserv/ypserv/ypserv.c,v
retrieving revision 1.25
diff -u -p -r1.25 ypserv.c
--- usr.sbin/ypserv/ypserv/ypserv.c 30 Aug 2011 17:06:22 -0000 1.25
+++ usr.sbin/ypserv/ypserv/ypserv.c 1 Mar 2012 22:16:26 -0000
@@ -94,7 +94,7 @@ static void usage(void) __dead;
static int bind_resv_port(int, sa_family_t, in_port_t);
void ypserv_sock_hostname(struct host_info *host);
-static void
+static __printflike(2, 3) void
_msgout(int level, const char *msg, ...)
{
va_list ap;
Home |
Main Index |
Thread Index |
Old Index