]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: stats: let gcc know that last_fwd cannot be used uninitialized...
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Apr 2014 18:26:41 +0000 (20:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Apr 2014 18:26:41 +0000 (20:26 +0200)
OK, for once it cannot easily know this one, and certain versions are
emitting this harmless warning :

  src/dumpstats.c: In function 'http_stats_io_handler':
  src/dumpstats.c:4507:19: warning: 'last_fwd' may be used uninitialized in this function [-Wmaybe-uninitialized]

src/dumpstats.c

index b35a5a85d3b65947b64e1f284f91e9e5b888a45a..dd017e191b08d26e9a7b6f75620d819d8cee5bee 100644 (file)
@@ -4462,7 +4462,7 @@ static void http_stats_io_handler(struct stream_interface *si)
                unsigned int prev_len = si->ib->buf->i;
                unsigned int data_len;
                unsigned int last_len;
-               unsigned int last_fwd;
+               unsigned int last_fwd = 0;
 
                if (appctx->ctx.stats.flags & STAT_CHUNKED) {
                        /* One difficulty we're facing is that we must prevent