Received: from eggs.gnu.org ([208.118.235.92]:55674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U26Fg-0006jy-E9 for qemu-devel@nongnu.org; Sun, 03 Feb 2013 15:33:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U26Fd-0005pD-Og for qemu-devel@nongnu.org; Sun, 03 Feb 2013 15:33:24 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:56400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U26Fd-0005om-Hd for qemu-devel@nongnu.org; Sun, 03 Feb 2013 15:33:21 -0500 From: Stefan Weil Date: Sun, 3 Feb 2013 21:33:16 +0100 Message-Id: <1359923596-26955-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH for 1.4] target-s390x: Fix wrong comparison in interrupt handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Alexander Graf , qemu-devel@nongnu.org Cc: Stefan Weil gcc with -Wextra complains about an ordered pointer comparison: target-s390x/helper.c:660:27: warning: ordered comparison of pointer with integer zero [-Wextra] Obviously the index was missing in the code. Signed-off-by: Stefan Weil --- I hope my analysis and the fix is correct - please review. For local builds, I always compile with -Wextra. This bug shows that -Wextra would be good as a default compiler option for QEMU. Of course some extra warnings must be explicitly disabled then. I'll send a patch for this after 1.4. Regards, Stefan W. target-s390x/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-s390x/helper.c b/target-s390x/helper.c index 3180b90..8bd84ef 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -657,7 +657,7 @@ static void do_io_interrupt(CPUS390XState *env) cpu_unmap_lowcore(lowcore); env->io_index[isc]--; - if (env->io_index >= 0) { + if (env->io_index[isc] >= 0) { disable = 0; } break; -- 1.7.10.4