From 138dbfa980084127b0ea61473473a9cb4c5acdb4 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 9 Dec 2013 07:56:36 +0100 Subject: [PATCH] exec: Fix compiler warning (-Werror=clobbered) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gcc 4.7 shows a new warning when -Wclobbered (which is part of -Wextra) is enabled: qemu/exec.c:921:11: error: variable ‘area’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered] The warning is caused by sigsetjmp which was added in commit ef36fa1492e9105f3fa607b56edc63df513d7da1. Declaring the variable with attribute 'volatile' fixes the warning. Signed-off-by: Stefan Weil --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 480d1f19cd..07ddd257bb 100644 --- a/exec.c +++ b/exec.c @@ -924,7 +924,7 @@ static void *file_ram_alloc(RAMBlock *block, char *filename; char *sanitized_name; char *c; - void *area; + void * volatile area; int fd; uintptr_t hpagesize; -- 2.11.4.GIT