]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
examples: Initialize @pos in domtop.c
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 15 Apr 2019 09:19:31 +0000 (11:19 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 15 Apr 2019 09:39:26 +0000 (11:39 +0200)
This is a zero-cost workaround for a bug in GCC 8.3.0 which causes the
compilation to fail, because the compiler thinks that the value might be used
uninitialized even though it clearly cannot be.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
examples/domtop/domtop.c

index c9b51aed510de99dd0b76342bebe08bbcad37362..e463e2873f424d69ea7c780aa1d441d270a4c2d3 100644 (file)
@@ -206,7 +206,7 @@ print_cpu_usage(size_t cpu,
     }
 
     for (i = 0; i < ncpus; i++) {
-        size_t pos;
+        size_t pos = 0;
         double usage;
 
         /* check if the vCPU is in the maps */