]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] silent gcc for a wrong warning
authorWilly Tarreau <w@1wt.eu>
Tue, 4 Mar 2008 05:38:57 +0000 (06:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 4 Mar 2008 05:38:57 +0000 (06:38 +0100)
gcc believes that avoididx may be used uninitialized, which is wrong.

include/proto/backend.h

index c4ffe8522685048295313401c4f03304732ab99e..1720105ca3b67f7500ab885356cecc8dfda8c1b7 100644 (file)
@@ -66,6 +66,7 @@ static inline struct server *get_server_rr_with_conns(struct proxy *px, struct s
        newidx = px->lbprm.map.rr_idx;
 
        avoided = NULL;
+       avoididx = 0; /* shut a gcc warning */
        do {
                srv = px->lbprm.map.srv[newidx++];
                if (!srv->maxconn || srv->cur_sess < srv_dynamic_maxconn(srv)) {