From 666f5049069e2d05bd31b421f7cffb12545d29af Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 17 Jun 2015 19:49:52 +0200 Subject: [PATCH] BUILD/MINOR: stats: fix build warning due to condition always true Dmitry Sivachenko reported the following harmless build warning using Clang : src/dumpstats.c:5196:48: warning: address of array 'strm_li(sess)->proto->name' will always evaluate to 'true' [-Wpointer-bool-conversion] ...strm_li(sess) && strm_li(sess)->proto->name ? strm_li(sess)->proto->nam... ~~ ~~~~~~~~~~~~~~~~~~~~~~^~~~ proto->name cannot be null here as it's the protocol name which is stored directly in the structure. The same case is present in 1.5 though the code changed. --- src/dumpstats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dumpstats.c b/src/dumpstats.c index 96180fe71..c8bdc2b6a 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -5193,7 +5193,7 @@ static int stats_dump_full_sess_to_buffer(struct stream_interface *si, struct st tm.tm_mday, monthname[tm.tm_mon], tm.tm_year+1900, tm.tm_hour, tm.tm_min, tm.tm_sec, (int)(sess->logs.accept_date.tv_usec), sess->uniq_id, - strm_li(sess) && strm_li(sess)->proto->name ? strm_li(sess)->proto->name : "?"); + strm_li(sess) ? strm_li(sess)->proto->name : "?"); conn = objt_conn(strm_orig(sess)); switch (conn ? addr_to_str(&conn->addr.from, pn, sizeof(pn)) : AF_UNSPEC) {