From 09d7ae9000fe27d1861cb0348cbf71563ded6148 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Wed, 7 Jul 2010 19:37:53 +0000 Subject: [PATCH] Fix warning about uninitialized variable With gcc 4.2.1-sjlj (mingw32-2) I get this warning: /src/qemu/exec.c: In function 'qemu_ram_alloc': /src/qemu/exec.c:2777: warning: 'offset' may be used uninitialized in this function Fix by initializing the variable. Signed-off-by: Blue Swirl --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 5420f564b5..4641b3eb6e 100644 --- a/exec.c +++ b/exec.c @@ -2774,7 +2774,7 @@ static void *file_ram_alloc(RAMBlock *block, static ram_addr_t find_ram_offset(ram_addr_t size) { RAMBlock *block, *next_block; - ram_addr_t offset, mingap = ULONG_MAX; + ram_addr_t offset = 0, mingap = ULONG_MAX; if (QLIST_EMPTY(&ram_list.blocks)) return 0; -- 2.11.0