BUILD: http_fetch: silence an uninitiialized warning with gcc-4/5/6 at -Os
Gcc 4.x, 5.x and 6.x report this when compiling http_fetch.c:
src/http_fetch.c: In function 'smp_fetch_meth':
src/http_fetch.c:357:6: warning: 'htx' may be used uninitialized in this function [-Wmaybe-uninitialized]
sl = http_get_stline(htx);
That's quite weird since there's no such code path, but presetting the
htx variable to NULL during declaration is enough to shut it up.
This may be backported to any version that has dbbdb25f1 ("BUG/MINOR:
http-fetch: Use integer value when possible in "method" sample fetch")
as it's the one that triggered this warning (hence at least 2.0).
(cherry picked from commit 2e2b79d157944d12922ae7ad487247259f3e6d70)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit fb36fd0f01c96a923b9854673b0d1251c2f95dd6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit ba3ccfa73fccdc7ef7bf9592e4be2e88866a289a)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed