From: Willy Tarreau Date: Sun, 21 Mar 2010 22:21:00 +0000 (+0100) Subject: [CLEANUP] stats: remove printf format warning in stats_dump_full_sess_to_buffer() X-Git-Tag: v1.4.3~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e1554c295f4c572d829982bdcb7e2556ea23167;p=thirdparty%2Fhaproxy.git [CLEANUP] stats: remove printf format warning in stats_dump_full_sess_to_buffer() This warning was first reported by Ross West on FreeBSD, then by Holger Just on OpenSolaris. It also happens on 64bit Linux. However, fixing the format to use long int complains on 32bit Linux where ptrdiff_t is apparently different. Better cast the pointer difference to an int then. --- diff --git a/src/dumpstats.c b/src/dumpstats.c index d200e928c6..71a323cb34 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -2463,9 +2463,9 @@ int stats_dump_full_sess_to_buffer(struct session *s, struct buffer *rep) human_time(TICKS_TO_MS(sess->req->wex - now_ms), TICKS_TO_MS(1000)) : "", sess->req->data, - sess->req->r - sess->req->data, - sess->req->w - sess->req->data, - sess->req->lr - sess->req->data, + (int)(sess->req->r - sess->req->data), + (int)(sess->req->w - sess->req->data), + (int)(sess->req->lr - sess->req->data), sess->req->total); chunk_printf(&msg, @@ -2493,9 +2493,9 @@ int stats_dump_full_sess_to_buffer(struct session *s, struct buffer *rep) human_time(TICKS_TO_MS(sess->rep->wex - now_ms), TICKS_TO_MS(1000)) : "", sess->rep->data, - sess->rep->r - sess->rep->data, - sess->rep->w - sess->rep->data, - sess->rep->lr - sess->rep->data, + (int)(sess->rep->r - sess->rep->data), + (int)(sess->rep->w - sess->rep->data), + (int)(sess->rep->lr - sess->rep->data), sess->rep->total); if (buffer_feed_chunk(rep, &msg) >= 0)