BUILD: ist: prevent gcc11 maybe-uninitialized warning on istalloc
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 May 2021 09:33:57 +0000 (11:33 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 20 Sep 2021 15:04:17 +0000 (17:04 +0200)
commitad2c8298cc00fce0aac6864c1903eec4c114b4f0
tree26688c8a35dd0d44e1dae3e29b2cf2e4836ca0c4
parent72d8b495fcfd4eb28549818f695f5d5648e31b52
BUILD: ist: prevent gcc11 maybe-uninitialized warning on istalloc

A new warning is reported by gcc11 when using a pointer to uninitialized
memory block for a function with a const pointer argument. The warning
is triggered for istalloc, used by http_client.c / proxy.c / tcpcheck.c.

This warning is reported because the uninitialized memory block
allocated by malloc should not be passed to a const argument as in ist2.
See https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized

This should be backported up to 2.2.

(cherry picked from commit 7a8aff26881c58061d6ca98d3c3e5fc70060c8f4)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 3471051fe113619fd3a6165cc301894a085056aa)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/import/ist.h