aboutsummaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-22 11:23:59 -0700
committerJunio C Hamano <gitster@pobox.com>2013-07-22 11:23:59 -0700
commite9f1a6c189c34a7ea98cbdb92acc677a72a5b4ea (patch)
tree54a4008e527cd1094e14cc9914c0cc55ac46a0a6 /transport-helper.c
parentd0b3fa8fd9faf5d18d54e2beb04741fff88af358 (diff)
parent9fe3edc47f1f17a53272671c572c90ba71eb4f74 (diff)
downloadgit-e9f1a6c189c34a7ea98cbdb92acc677a72a5b4ea.tar.gz
git-e9f1a6c189c34a7ea98cbdb92acc677a72a5b4ea.tar.xz
Merge branch 'jk/gcc-function-attributes'
Use the function attributes extension to catch mistakes in use of our own variadic functions that use NULL sentinel at the end (i.e. like execl(3)) and format strings (i.e. like printf(3)). * jk/gcc-function-attributes: Add the LAST_ARG_MUST_BE_NULL macro wt-status: use "format" function attribute for status_printf use "sentinel" function attribute for variadic lists add missing "format" function attributes
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/transport-helper.c b/transport-helper.c
index db9bd1829..45a35df66 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -982,6 +982,7 @@ int transport_helper_init(struct transport *transport, const char *name)
#define PBUFFERSIZE 8192
/* Print bidirectional transfer loop debug message. */
+__attribute__((format (printf, 1, 2)))
static void transfer_debug(const char *fmt, ...)
{
va_list args;
@@ -1067,7 +1068,7 @@ static int udt_do_read(struct unidirectional_transfer *t)
return -1;
} else if (bytes == 0) {
transfer_debug("%s EOF (with %i bytes in buffer)",
- t->src_name, t->bufuse);
+ t->src_name, (int)t->bufuse);
t->state = SSTATE_FLUSHING;
} else if (bytes > 0) {
t->bufuse += bytes;