[PATCH 2/2] tool/libx: Fix libxenlight gcc warning

Bertrand Marquis posted 2 patches 1 month, 3 weeks ago
Maintainers: Anthony PERARD <anthony.perard@citrix.com>, Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>

[PATCH 2/2] tool/libx: Fix libxenlight gcc warning

Posted by Bertrand Marquis 1 month, 3 weeks ago
Fix gcc10 compilation warning about uninitialized variable by setting
it to 0.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 tools/libxl/libxl_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_mem.c b/tools/libxl/libxl_mem.c
index e52a9624ea..c739d00f39 100644
--- a/tools/libxl/libxl_mem.c
+++ b/tools/libxl/libxl_mem.c
@@ -562,7 +562,7 @@ out:
 
 int libxl_get_free_memory_0x040700(libxl_ctx *ctx, uint32_t *memkb)
 {
-    uint64_t my_memkb;
+    uint64_t my_memkb = 0;
     int rc;
 
     rc = libxl_get_free_memory(ctx, &my_memkb);
-- 
2.17.1


Re: [PATCH 2/2] tool/libx: Fix libxenlight gcc warning

Posted by Wei Liu 1 month, 3 weeks ago
On Mon, Oct 05, 2020 at 05:02:49PM +0100, Bertrand Marquis wrote:
> Fix gcc10 compilation warning about uninitialized variable by setting
> it to 0.
> 
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>

Acked-by: Wei Liu <wl@xen.org>