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.
diff --git a/src/quic_conn.c b/src/quic_conn.c
index dd74894..4edd5f9 100644
--- a/src/quic_conn.c
+++ b/src/quic_conn.c
@@ -6089,7 +6089,7 @@
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);
diff --git a/src/quic_tp.c b/src/quic_tp.c
index 50fca0c..78c456a 100644
--- a/src/quic_tp.c
+++ b/src/quic_tp.c
@@ -584,12 +584,11 @@
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;