Hi,

When checking Brane's work on the CMake build system, I investigated a few
compiler warnings. There are a few instances of "‘avail’ may be used
uninitialized", Avail is passed to select_value (as the parameter *len) and
SHOULD be initialized there, however there is a default:-statement in a
switch that is "Not reachable" according to a comment and this path leaves
*len uninitialised.

Can we do something to silence this warning? The below seems to work, but
maybe there are better ways

[[[
Index: serf_trunk/buckets/headers_buckets.c
===================================================================
--- serf_trunk/buckets/headers_buckets.c        (revision 1926051)
+++ serf_trunk/buckets/headers_buckets.c        (working copy)
@@ -312,6 +312,7 @@ static void select_value(
         return;
     default:
         /* Not reachable */
+        *len = 0;
         return;
     }
]]]

Cheers,
Daniel

Reply via email to