From patchwork Sun Oct 14 20:00:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 191389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E56BD2C009B for ; Mon, 15 Oct 2012 07:28:36 +1100 (EST) Received: from localhost ([::1]:35103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNUMo-0002jR-OD for incoming@patchwork.ozlabs.org; Sun, 14 Oct 2012 16:00:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNUMd-0002V3-Q0 for qemu-devel@nongnu.org; Sun, 14 Oct 2012 16:00:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNUMc-0003Eb-JZ for qemu-devel@nongnu.org; Sun, 14 Oct 2012 16:00:43 -0400 Received: from 38.0.169.217.in-addr.arpa ([217.169.0.38]:55275 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNUMc-0003Dp-CO for qemu-devel@nongnu.org; Sun, 14 Oct 2012 16:00:42 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1TNUMZ-0004Oc-Gd; Sun, 14 Oct 2012 21:00:39 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Sun, 14 Oct 2012 21:00:39 +0100 Message-Id: <1350244839-16875-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 217.169.0.38 Cc: Blue Swirl , Stefan Weil , patches@linaro.org Subject: [Qemu-devel] [PATCH] configure: Disable (clang) initializer-overrides warnings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Disable clang's initializer-overrides warnings, as QEMU makes significant use of the pattern of initializing an array with a range-based default entry like [0 ... 0x1ff] = { GPIO_NONE, 0 } followed by specific entries which override that default, and clang would otherwise warn "initializer overrides prior initialization of this subobject" when it encountered the specific entry. Signed-off-by: Peter Maydell --- This is basically a judgement that our coding style is legitimate and the compiler is being overly alarmist. I don't think we would benefit from trying to silence the warnings and I can't think of a clean way of doing so... NB that gcc will happily ignore -Wno-wombat warnings that it doesn't happen to recognize. (For compilers that don't accept-and-ignore the flag configure will identify this and not use it.) Blue Swirl previously submitted a patch which enabled this flag (among others): http://lists.gnu.org/archive/html/qemu-devel/2012-07/msg04203.html I haven't found the other two flags in that patch to be required. configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 353d788..f78cfc5 100755 --- a/configure +++ b/configure @@ -1187,6 +1187,7 @@ gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" gcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags" +gcc_flags="-Wno-initializer-overrides $gcc_flags" # Note that we do not add -Werror to gcc_flags here, because that would # enable it for all configure tests. If a configure test failed due # to -Werror this would just silently disable some features,