Compiler warning: use of possibly-uninitialized variable
ctf-visitor-generate-io-struct.c: In function 'ctf_visitor_construct_metadata': ctf-visitor-generate-io-struct.c:2744:16: warning: 'v' may be used uninitialized in this function [-Wmaybe-uninitialized] env->vpid = (int) v; ^~~~~~~ ctf-visitor-generate-io-struct.c:2733:13: note: 'v' was declared here uint64_t v; ^
Upon inspecting function
get_unary_unsigned in source:formats/ctf/metadata/ctf-visitor-generate-io-struct.c#L183 one can see that if the
head list is empty, 0 is returned and
v is unchanged. I would propose a patch but I don't feel confident as to what would be a safe default initializer for
v prior to calling
get_unary_unsigned (zero would be guessing and point to invalid PID).