From patchwork Tue Feb 1 15:54:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 81332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A1870B70EB for ; Wed, 2 Feb 2011 02:57:13 +1100 (EST) Received: from localhost ([127.0.0.1]:56771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkIbP-0000FO-1y for incoming@patchwork.ozlabs.org; Tue, 01 Feb 2011 10:57:11 -0500 Received: from [140.186.70.92] (port=54638 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkIZK-0006pJ-Re for qemu-devel@nongnu.org; Tue, 01 Feb 2011 10:55:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkIZJ-00021C-Dv for qemu-devel@nongnu.org; Tue, 01 Feb 2011 10:55:02 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:52828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkIZJ-0001yj-6o for qemu-devel@nongnu.org; Tue, 01 Feb 2011 10:55:01 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1PkIZA-00064m-Gw; Tue, 01 Feb 2011 15:54:52 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 1 Feb 2011 15:54:52 +0000 Message-Id: <1296575692-23335-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Blue Swirl , Riku Voipio , patches@linaro.org Subject: [Qemu-devel] [PATCH] linux-user: avoid gcc array overrun warning for sparc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Suppress a gcc array bounds overrun warning when filling in the SPARC signal frame by adjusting our definition of the structure so that the fp and callers_pc membes are part of the ins[] array rather than separate fields; since qemu has no need to access the fields individually there is no need to follow the kernel's structure field naming exactly. Signed-off-by: Peter Maydell --- This is a fix for another warning that the armel gcc gives: linux-user/signal.c:1979: error: array subscript is above array bounds so if it passes review I think it's a good candidate for putting in 0.14. linux-user/signal.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 0664770..b01bd64 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -1817,9 +1817,10 @@ struct target_sigcontext { /* A Sparc stack frame */ struct sparc_stackf { abi_ulong locals[8]; - abi_ulong ins[6]; - struct sparc_stackf *fp; - abi_ulong callers_pc; + abi_ulong ins[8]; + /* It's simpler to treat fp and callers_pc as elements of ins[] + * since we never need to access them ourselves. + */ char *structptr; abi_ulong xargs[6]; abi_ulong xxargs[1];