BUILD: quic: silence two invalid build warnings at -O1 with gcc-6.5

Gcc 6.5 is now well known for triggering plenty of false "may be used
uninitialized", particularly at -O1, and two of them happen in quic,
quic_tp and quic_conn. Both of them were reviewed and easily confirmed
as wrong (gcc seems to ignore the control flow after the function
returns and believes error conditions are not met). Let's just preset
the variables that bothers it. In quic_tp the initialization was moved
out of the loop since there's no point inflating the code just to
silence a stupid warning.
This commit is contained in:
Willy Tarreau 2022-11-24 09:16:41 +01:00
parent d2ff5dc3eb
commit 33a6870fea
2 changed files with 2 additions and 3 deletions

View File

@ -6089,7 +6089,7 @@ static int quic_rx_pkt_parse(struct quic_rx_packet *pkt,
struct proxy *prx;
struct quic_counters *prx_counters;
int long_header = 0;
uint32_t version;
uint32_t version = 0;
const struct quic_version *qv = NULL;
TRACE_ENTER(QUIC_EV_CONN_LPKT);

View File

@ -584,12 +584,11 @@ static int quic_transport_params_decode(struct quic_transport_params *p, int ser
const unsigned char *end)
{
const unsigned char *pos;
uint64_t type, len = 0;
pos = buf;
while (pos != end) {
uint64_t type, len;
if (!quic_transport_param_decode_type_len(&type, &len, &pos, end))
return 0;